Skip to content

Commit

Permalink
fix ensembl tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tcezard committed Oct 21, 2024
1 parent 5c7f3cb commit 49da6ea
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_vep_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ def fake_dir(path, callback):

def test_get_vep_versions_from_ensembl(self):
vep_version, cache_version = get_vep_and_vep_cache_version_from_ensembl('GCA_000827895.1')
self.assertEqual(vep_version, 112)
self.assertEqual(cache_version, 59)
self.assertEqual(vep_version, 113)
self.assertEqual(cache_version, 60)
assert os.path.exists(os.path.join(cfg['vep_cache_path'], 'thelohanellus_kitauei'))
assert os.listdir(os.path.join(cfg['vep_cache_path'], 'thelohanellus_kitauei')) == ['59_ASM82789v1']
assert os.listdir(os.path.join(cfg['vep_cache_path'], 'thelohanellus_kitauei')) == ['60_ASM82789v1']

def test_get_vep_versions_from_ensembl_not_found(self):
vep_version, cache_version = get_vep_and_vep_cache_version_from_ensembl('GCA_015220235.1')
Expand Down Expand Up @@ -117,9 +117,9 @@ def test_get_vep_versions(self):
def test_get_vep_and_vep_cache_version_with_vep_download(self):
with patch('eva_submission.vep_utils.get_vep_and_vep_cache_version_from_db') as m_get_db, \
patch('eva_submission.vep_utils.command_utils.run_command_with_output'):
m_get_db.return_value = (112, 59)
m_get_db.return_value = (113, 60)
get_vep_and_vep_cache_version('fake_mongo', 'fake_db', 'fake_assembly')
assert os.path.exists(os.path.join(cfg['vep_path'], 'ensembl-vep-release-112'))
assert os.path.exists(os.path.join(cfg['vep_path'], 'ensembl-vep-release-113'))

def test_download_and_extract_vep_cache(self):
with patch('eva_submission.vep_utils.retrieve_species_scientific_name_from_tax_id_ncbi') as m_get_scf_name:
Expand Down Expand Up @@ -157,5 +157,5 @@ def test_get_releases(self):
assert get_releases(ftp, 'pub', current_only=True) == {113: 'pub/release-113'}

with get_ftp_connection(ensembl_genome_ftp_url) as ftp:
assert get_releases(ftp, ensembl_genome_dirs[0], current_only=True) == {59: 'ensemblgenomes/pub/plants/release-59'}
assert get_releases(ftp, ensembl_genome_dirs[0], current_only=True) == {60: 'ensemblgenomes/pub/plants/release-60'}

0 comments on commit 49da6ea

Please sign in to comment.