-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'issue-511' into extended-511
- Loading branch information
Showing
5 changed files
with
21 additions
and
54 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 |
---|---|---|
|
@@ -28,6 +28,9 @@ def setUpModule(): | |
"git clone -b tests --single-branch [email protected]:ISA-tools/ISAdatasets {0}" | ||
.format(utils.DATA_DIR)) | ||
|
||
def replace_windows_newlines(input_string): | ||
return input_string.replace('\r\r\n', '\n').replace('\r\n', '\n').replace('\r', '\n') | ||
|
||
|
||
def replace_windows_newlines(input_string): | ||
return input_string.replace('\r\r\n', '\n').replace('\r\n', '\n').replace('\r', '\n') | ||
|
@@ -445,7 +448,7 @@ def test_isatab_dump_source_sample_char_quant(self): | |
s.process_sequence = [sample_collection_process] | ||
s.samples.append(sample1) | ||
i.studies = [s] | ||
actual = isatab.dumps(i) | ||
actual = replace_windows_newlines(isatab.dumps(i)) | ||
expected = """Source Name\tMaterial Type\tCharacteristics[organism]\tTerm Source REF\tTerm Accession Number\tCharacteristics[body weight]\tUnit\tTerm Source REF\tTerm Accession Number\tProtocol REF\tParameter Value[vessel]\tTerm Source REF\tTerm Accession Number\tParameter Value[storage temperature]\tUnit\tTerm Source REF\tTerm Accession Number\tSample Name\tCharacteristics[organism part]\tTerm Source REF\tTerm Accession Number\tCharacteristics[specimen mass]\tUnit\tTerm Source REF\tTerm Accession Number | ||
source1\tspecimen\tHuman\tNCBITAXON\thttp://purl.bioontology.org/ontology/STY/T016\t72\tkilogram\tUO\thttp://purl.obolibrary.org/obo/UO_0000009\tsample collection\teppendorf tube\tOBI\tpurl.org\t-20\tdegree Celsius\tUO\thttp://purl.obolibrary.org/obo/UO_0000027\tsample1\tliver\tUBERON\thttp://purl.obolibrary.org/obo/UBERON_0002107\t450.5\tmilligram\tUO\thttp://purl.obolibrary.org/obo/UO_0000022""" | ||
self.assertIn(expected, actual) | ||
|
@@ -1269,7 +1272,8 @@ def test_source_protocol_ref_sample_protocol_ref_sample(self): | |
i.studies = [s] | ||
expected = """Source Name\tProtocol REF\tSample Name\tProtocol REF\tSample Name | ||
source1\tsample collection\tsample1\taliquoting\taliquot1""" | ||
self.assertIn(expected, isatab.dumps(i).replace('\r\r\n', '\n').replace('\r\n', '\n').replace('\r', '\n')) | ||
self.assertIn(expected, replace_windows_newlines(isatab.dumps(i))) | ||
|
||
|
||
def test_sample_protocol_ref_material_protocol_ref_data2(self): | ||
i = Investigation() | ||
|
@@ -1727,6 +1731,7 @@ def test_isatab_preprocess_issue235(self): | |
if """Protocol REF\tData Transformation Name""" in header: | ||
self.fail('Incorrectly inserted Protocol REF before ' | ||
'Data Transformation Name') | ||
os.remove(tmp.name) | ||
|
||
def test_isatab_factor_value_parsing_issue270(self): | ||
with open(os.path.join(self._tab_data_dir, 'issue270', 'i_matteo.txt'), | ||
|
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