Skip to content

Commit

Permalink
Bugfix token attribute.
Browse files Browse the repository at this point in the history
Bugfix missing update on headers token appending.
  • Loading branch information
sunset666 committed Sep 11, 2024
1 parent 936e3ba commit 5735131
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import tifffile
import xmlschema
from ingest_validation_tools.plugin_validator import Validator

from ingest_validation_tests.utils import GetParentData


Expand Down Expand Up @@ -44,6 +45,7 @@ class ImageSizeValidator(Validator):

def collect_errors(self, **kwargs) -> List[Optional[str]]:
del kwargs
print("Validating Image/SegMask sizes")
if self.required not in self.contains and self.assay_type.lower() != self.required:
return [] # We only test Segmentation Masks
files_tested = None
Expand All @@ -62,7 +64,7 @@ def collect_errors(self, **kwargs) -> List[Optional[str]]:

for file in Path(
GetParentData(
row["parent_dataset_id"], self.globus_token, self.app_context
row["parent_dataset_id"], self.token, self.app_context
).get_path()
).glob(glob_expr):
parent_filenames_to_test.append(file)
Expand Down
2 changes: 1 addition & 1 deletion src/ingest_validation_tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __init__(self, hubmap_id, globus_token, app_context):
def __get_uuid(self) -> None:
url = self.app_context.get("uuid_url") + self.hubmap_id
headers = self.app_context.get("request_headers", {})
headers({"Authorization": "Bearer " + self.token})
headers.update({"Authorization": "Bearer " + self.token})
try:
response = requests.get(url, headers=headers)
response.raise_for_status()
Expand Down

0 comments on commit 5735131

Please sign in to comment.