diff --git a/tests/data/i_small2/i_small2.txt b/tests/data/i_small2/i_small2.txt index 5741cd6..7d2b8cf 100644 --- a/tests/data/i_small2/i_small2.txt +++ b/tests/data/i_small2/i_small2.txt @@ -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 diff --git a/tests/test_modify_investigation.py b/tests/test_modify_investigation.py new file mode 100644 index 0000000..8b9eae2 --- /dev/null +++ b/tests/test_modify_investigation.py @@ -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)