Skip to content

Commit

Permalink
add check for parent & internal locations in MultiIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Jul 4, 2021
1 parent 5e6d26f commit 0f03178
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,15 +1170,22 @@ def test_multi_index_load_from_path():
# 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')
endings = ('GCA_001593925.1_ASM159392v1_protein.faa.gz.sig',
'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}"

# also check internal locations and parent value --
assert mi.parent.endswith('prot/protein')

ilocs = [ x[2] for x in mi._signatures_with_internal() ]
assert endings[0] in ilocs, ilocs
assert endings[1] in ilocs, ilocs


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 0f03178

Please sign in to comment.