def test_load_runs(): summary = StudySummary() requested_runs = [ '/fake/path/200101_M11111_0001_0000000-J1HRQ', '/fake/path/200108_M11111_0002_0000000-P3RS4' ] summary.load_runs(requested_runs) assert summary.run_paths == tuple( Path(run_path) for run_path in requested_runs)
def test_load_runs_not_in_samples(tmp_path): runs_root = tmp_path run1_path = runs_root / '200101_M11111_0001_0000000-J1HRQ' run1_path.mkdir() run2_path = runs_root / '200115_M22222_0003_0000000-Y8E4T' run2_path.mkdir() samples_csv = StringIO("""\ sample,run,pid E0001-NFLHIVDNA_S1,200101_M11111,P1 E0002-NFLHIVDNA_S2,200101_M11111,P2 """) requested_runs = [str(run1_path), str(run2_path)] summary = StudySummary() summary.load_runs(requested_runs) summary.load_samples(samples_csv, runs_root) assert summary.run_paths == (run1_path, run2_path)