-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes regression bug with EBI Search dump commands, following refacto…
…ring for metagenomics exchange. also adds some simple e2e tests for ebisearch dump commands. (#352)
- Loading branch information
1 parent
c98171c
commit 1f2ec72
Showing
7 changed files
with
54 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__: str = "2.4.45" | ||
__version__: str = "2.4.46" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import os | ||
|
||
import pytest | ||
from django.core.management import call_command | ||
|
||
from test_utils.emg_fixtures import * # noqa | ||
|
||
@pytest.mark.django_db(transaction=True) | ||
@pytest.mark.usefixtures("experiment_type") | ||
class TestEbiSearchDump: | ||
def test_dump_studies(self, sample): | ||
"""Test ebi search dump studies""" | ||
call_command( | ||
"ebi_search_study_dump", "-o", f"/tmp/emg_dump_studies", | ||
) | ||
assert os.path.exists(f"/tmp/emg_dump_studies/projects.xml") | ||
assert os.path.isfile(f"/tmp/emg_dump_studies/projects.xml") | ||
assert os.path.exists(f"/tmp/emg_dump_studies/projects-deletes.xml") | ||
assert os.path.isfile(f"/tmp/emg_dump_studies/projects-deletes.xml") | ||
|
||
with open(f"/tmp/emg_dump_studies/projects.xml") as f: | ||
dump = f.read() | ||
assert "MGYS00001234" in dump | ||
assert "<entry_count>1</entry_count>" in dump | ||
|
||
with open(f"/tmp/emg_dump_studies/projects-deletes.xml") as f: | ||
dump = f.readlines() | ||
assert len(dump) == 5 # i.e. no entries within the xml | ||
|
||
def test_dump_analyses(self, run_v5): | ||
"""Test ebi search dump analyses""" | ||
call_command( | ||
"ebi_search_analysis_dump", "-o", f"/tmp/emg_dump_analyses", | ||
) | ||
assert os.path.exists(f"/tmp/emg_dump_analyses/analyses_0001.xml") | ||
assert os.path.isfile(f"/tmp/emg_dump_analyses/analyses_0001.xml") | ||
assert os.path.exists(f"/tmp/emg_dump_analyses/analyses-deletes.xml") | ||
assert os.path.isfile(f"/tmp/emg_dump_analyses/analyses-deletes.xml") | ||
|
||
with open(f"/tmp/emg_dump_analyses/analyses_0001.xml") as f: | ||
dump = f.read() | ||
assert "MGYA00001234" in dump | ||
assert "<entry_count>1</entry_count>" in dump | ||
|
||
with open(f"/tmp/emg_dump_analyses/analyses-deletes.xml") as f: | ||
dump = f.readlines() | ||
assert len(dump) == 5 # i.e. no entries within the xml | ||
|
File renamed without changes.
File renamed without changes.