def test_read_in_ids_tsv_keep_separated(ids_tsv): sample_dict = read_in_ids(ids_tsv, keep_separated=True) assert len(sample_dict) == 2 assert 'Sample1' in sample_dict assert set(sample_dict['Sample1']) == {'K00001', 'K00002'} assert 'Sample2' in sample_dict assert set(sample_dict['Sample2']) == {'K00001', 'K00003'}
def test_read_in_ids_tsv(ids_tsv, list_of_kos): ids = read_in_ids(ids_tsv, name='Sample1') assert len(ids) == 1 assert set(ids['Sample1']) == set(list_of_kos)
def test_read_in_ids_bad_ending(): with pytest.raises(ValueError): ids = read_in_ids('fake.xkcd')
def test_read_in_ids_txt(ids_txt, list_of_kos): ids = read_in_ids(ids_txt, name='Sample1') assert len(ids) == 1 assert ids['Sample1'] == set(list_of_kos)
def test_read_in_ids_biom(ids_biom, list_of_kos): ids = read_in_ids(ids_biom, keep_separated=False, name='Sample1') assert len(ids) == 1 assert set(ids['Sample1']) == set(list_of_kos)