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 Aug 28, 2023
1 parent a8692dc commit 618b892
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions micall/tests/test_sample_sheet_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,3 +777,46 @@ def test_read_sample_sheet_overrides(tmpdir):
assert len(split_rows) == 2
assert split_rows[0]['project'] == 'Proj1'
assert split_rows[1]['project'] == 'AltB'


class UnderscoreCases(unittest.TestCase):

@unittest.expectedFailure
def test_underscores_in_sample_name1(tmpdir):
sample_sheet_path = Path(str(tmpdir)) / 'SampleSheet.csv'

sample_sheet_path.write_text("""\
[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,
""")

with sample_sheet_path.open() as f:
run_info = sample_sheet_parser(f)

sample_map = run_info['Data']
assert len(sample_map) == 2

split_rows = run_info['DataSplit']
assert len(split_rows) == 2
assert split_rows[0]['project'] == 'Proj1'
assert split_rows[1]['project'] == 'Proj2'

0 comments on commit 618b892

Please sign in to comment.