Skip to content

Commit

Permalink
add tests for i_forge
Browse files Browse the repository at this point in the history
  • Loading branch information
sellth committed Oct 31, 2023
1 parent 5897ebb commit 6ad18e8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/data/i_small2/i_small2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ Study Protocol Type Term Source REF
Study Protocol Description
Study Protocol URI
Study Protocol Version
Study Protocol Parameters Name
Study Protocol Parameters Name Term Accession Number
Study Protocol Parameters Name Term Source REF
Study Protocol Parameters Name method;instrument
Study Protocol Parameters Name Term Accession Number ;
Study Protocol Parameters Name Term Source REF ;
Study Protocol Components Name
Study Protocol Components Type
Study Protocol Components Type Term Accession Number
Expand Down
21 changes: 21 additions & 0 deletions tests/test_modify_investigation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import pytest

from altamisa.isatab import InvestigationForge


def test_forge(assays_investigation_file):
# multiple studies
with pytest.raises(IndexError):
InvestigationForge(assays_investigation_file.name)


def test_add_assay(small_investigation_file, small2_investigation_file, assays_investigation_file):
forge = InvestigationForge(small_investigation_file.name)
forge.add_assay(small2_investigation_file.name)
output = forge.investigation
assert len(output.studies[0].assays) == 2
assert len(output.studies[0].protocols) == 8

# multiple studies
with pytest.raises(IndexError):
forge.add_assay(assays_investigation_file.name)

0 comments on commit 6ad18e8

Please sign in to comment.