Skip to content

Commit

Permalink
add token
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiangs18 committed Apr 25, 2024
1 parent 13733c2 commit 3302dcb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/supplemental_genbank_tests/genbank_upload_full_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def setUpClass(cls):
cls.dfuClient = DataFileUtil(os.environ['SDK_CALLBACK_URL'])
cls.hs = HandleService(cls.cfg['handle-service-url'], token=token)
cls.kbase_endpoint = cls.cfg['kbase-endpoint']
cls.token = token

@classmethod
def tearDownClass(cls):
Expand Down Expand Up @@ -230,7 +231,8 @@ def _get_shock_id(self, handle_id):

def _get_blobstore(self, shock_id):
blob_url = self.kbase_endpoint + "/blobstore/node/" + shock_id
response = requests.get(blob_url)
headers = {'authorization': 'OAuth ' + self.token}
response = requests.get(blob_url, headers=headers)
if response.status_code == 200:
data = response.json()
return data
Expand All @@ -243,7 +245,7 @@ def _get_blobstore(self, shock_id):
f"Error message: {error_message}; Error status: {error_data.get('status')}"
)
except Exception as e:
raise ValueError(f"Unable to parse error message") from e
raise ValueError(f"Failed to retrieve data from the blob store") from e

def _retrieve_provenance(self, provenance):
# make a deep copy to avoid modifying the original provenance
Expand Down

0 comments on commit 3302dcb

Please sign in to comment.