Skip to content

Commit

Permalink
Add a failing test for sample sheet parser
Browse files Browse the repository at this point in the history
This case tests the behaviour described in #888

When the issue is solved, we should unmark this case as "Failure".
  • Loading branch information
Donaim committed Jul 10, 2024
1 parent 06a1064 commit 65c1658
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions micall/tests/test_sample_sheet_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,44 @@ def test_extra_commas(self):
self.assertEqual(ss["Experiment Name"], "10-Jul-2014")


@unittest.expectedFailure
def test_underscores_in_sample_name(self):
"""
Extracts the correct project code having multiple options.
"""

stub_sample_sheet = """
[Header]
IEMFileVersion,3
Investigator Name,RL
Project Name,10-Jul-2014_v1test
Experiment Name,10-Jul-2014_v1test
Date,07/10/2014
Workflow,GenerateFASTQ
Assay,Nextera
Description,Nextera
Chemistry,Amplicon
[Reads]
251
251
[Settings]
[Data]
Sample_ID,Sample_Name,Sample_Plate,Sample_Well,index,index2,Sample_Project,Description,GenomeFolder
CFE_SomeId_10-Jul-2014_N501-N701_Sample1_Proj1,Sample1_Proj1,10-Jul-2014_testing,N/A,ACGTACGT,TGCATGCA,\
10-Jul-2014_testing,Research:Sample1_Proj1:TRUE Comments:Sample1_Proj1:thisiscommentone \
Disablecontamcheck:Sample1_Proj1:FALSE,
CFE_SomeId_10-Jul-2014_N501-N702_Sample2_Proj2,Sample2_Proj2,10-Jul-2014_testing,N/A,AAAAGGGG,CCCCTTTT,\
10-Jul-2014_testing,Research:Sample2_Foo_Proj2:FALSE Comments:Sample2_Foo_Proj2:thisiscommenttwo \
Chemistry:Sample2_Foo_Proj2:BreakingBad Disablecontamcheck:Sample2_Foo_Proj2:TRUE,
"""

ss = sample_sheet_parser(StringIO(stub_sample_sheet))
split_rows = ss['DataSplit']
assert len(split_rows) == 2
assert split_rows[0]['project'] == 'Proj1'
assert split_rows[1]['project'] == 'Proj2'


def test_read_sample_sheet_overrides(tmpdir):
sample_sheet_path = Path(str(tmpdir)) / 'SampleSheet.csv'
overrides_path = sample_sheet_path.parent / 'SampleSheetOverrides.csv'
Expand Down

0 comments on commit 65c1658

Please sign in to comment.