Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
tcezard committed May 26, 2022
1 parent 7e2cd0e commit 7dcd48e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion covid19dp_submission/download_analyses.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ def download_files(analyses_array, download_target_dir, processed_analyses_file)
def download_files_via_aspera(analyses_array, download_target_dir, processed_analyses_file, ascp, aspera_id_dsa,
batch_size=100):
logger.info(f"total number of files to download: {len(analyses_array)}")
print(f'{len(analyses_array)} analysis')
with open(processed_analyses_file, 'a') as open_file:
# This copy won't change throughout the iteration
for analysis_batch in chunked(copy.copy(analyses_array), batch_size):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_download_analyses.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ def check_processed_analysis_file(self, number_of_lines):
def test_download_analyses(self):
data = self.get_processed_files_data()
self.create_processed_analysis_file(data)
ascp_bin = os.path.expanduser("ascp")
ascp_bin = "ascp"
aspera_id_dsa_key = os.environ['ASPERA_ID_DSA']
download_analyses(project=self.project, num_analyses=self.num_analyses_to_download,
processed_analyses_file=self.processed_analyses_file,
download_target_dir=self.download_target_dir, ascp=ascp_bin,
aspera_id_dsa=aspera_id_dsa_key, batch_size=100)
vcf_files = glob.glob(f"{self.download_target_dir}/*.vcf")
vcf_files = glob.glob(f"{self.download_target_dir}/*.vcf") + glob.glob(f"{self.download_target_dir}/*.vcf.gz")
self.assertEqual(self.num_analyses_to_download, len(vcf_files))
self.check_processed_analysis_file(len(data) + self.num_analyses_to_download)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_ingest_covid19dp_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ def test_ingest_covid19dp_submission(self):
nextflow_config_file=self.nextflow_config_file, resume=None)
num_clustered_variants = self.mongo_db[self.accessioning_database_name]['clusteredVariantEntity'] \
.count_documents(filter={})
self.assertEqual(52, num_clustered_variants)
self.assertEqual(50, num_clustered_variants)
# check if files are synchronized to the ftp dir
self.assertEqual(2, len(glob.glob(f"{self.app_config['submission']['public_ftp_dir']}/*")))
num_incremental_release_records = self.mongo_db[self.accessioning_database_name]['releaseRecordEntity']\
.count_documents(filter={})
self.assertEqual(52, num_incremental_release_records)
self.assertEqual(50, num_incremental_release_records)

0 comments on commit 7dcd48e

Please sign in to comment.