Skip to content

Commit

Permalink
fix _md5sum_string bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiangs18 committed May 3, 2024
1 parent 96b3cc2 commit 580b8e5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/supplemental_genbank_tests/genbank_upload_full_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def _download_file_from_blobstore(self, shock_id):
return response_raw.text, response.text
raise ValueError(f"Failed to download file from the blob store; Error code {response.status_code}")

def _md5sum_string(data):
def _md5sum_string(self, data):
hash_md5 = hashlib.md5()
hash_md5.update(data.encode('utf-8'))
return hash_md5.hexdigest()
Expand Down Expand Up @@ -285,8 +285,10 @@ def _retrieve_genome_data(self, data):
shock_id = self._get_shock_id(handle_id)
blob_info_raw, blob_info = self._download_file_from_blobstore(shock_id)
target = data["md5"]
print(f"blob_info_raw is: {self._md5sum_string(blob_info_raw)}")
print(f"blob_info is: {self._md5sum_string(blob_info)}")
blob_info_raw_md5sum = self._md5sum_string(blob_info_raw)
blob_info_md5sum = self._md5sum_string(blob_info)
print(f"blob_info_raw is: {blob_info_raw_md5sum}")
print(f"blob_info is: {blob_info_md5sum}")
print(f"data md5 is: {target}")
# assert blob_info["data"]["file"]["checksum"]["md5"] == data["md5"]
# assert blob_info["data"]["file"]["name"] == data["id"]
Expand Down

0 comments on commit 580b8e5

Please sign in to comment.