Skip to content

Commit

Permalink
add test for MultiIndex re filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Jul 4, 2021
1 parent d6257a6 commit 5e6d26f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1159,12 +1159,26 @@ def test_multi_index_signatures():


def test_multi_index_load_from_path():
# test MultiIndex loading from a directory. The full paths to the
# signature files should be available via 'signatures_with_location()'
dirname = utils.get_test_data('prot/protein')
mi = MultiIndex.load_from_path(dirname, force=False)

sigs = list(mi.signatures())
assert len(sigs) == 2

# check to make sure that full paths to expected sig files are returned
locs = [ x[1] for x in mi.signatures_with_location() ]

endings = ('prot/protein/GCA_001593925.1_ASM159392v1_protein.faa.gz.sig',
'prot/protein/GCA_001593935.1_ASM159393v1_protein.faa.gz.sig')
for loc in locs:
found = False
for end in endings:
if loc.endswith(end):
found = True
assert found, f"could not find full filename in locations for {end}"


def test_multi_index_load_from_path_2():
# only load .sig files, currently; not the databases under that directory.
Expand Down

0 comments on commit 5e6d26f

Please sign in to comment.