Skip to content

Commit

Permalink
Reduce number of test files from 2 to 1 and make it smaller.
Browse files Browse the repository at this point in the history
Reduce number of test files from 2 to 1 and make it smaller.
Change doctest to be more comprehensive.
  • Loading branch information
claudiofr committed Aug 21, 2023
1 parent fcbfc46 commit 635a792
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 105,399 deletions.
25 changes: 15 additions & 10 deletions lib/galaxy/datatypes/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ def sniff_prefix(self, file_prefix: FilePrefix) -> bool:
>>> fname = get_test_fname( '1.chain' )
>>> Chain().sniff( fname )
True
>>> fname = get_test_fname( '2.chain' )
>>> Chain().sniff( fname )
True
>>>
"""
fh = file_prefix.string_io()
Expand All @@ -112,13 +109,21 @@ def sniff_prefix(self, file_prefix: FilePrefix) -> bool:
and tokens[6].isdigit()
):
return False
line = fh.readline().strip()
if line == "":
return False
tokens = line.split()
if len(tokens) not in [1, 3]:
return False
return all(token.isdigit() for token in tokens)
prior_token_len = 0
for line in fh:
line = line.strip()
if line == "":
break
tokens = line.split()
if prior_token_len == 1:
return False
if len(tokens) not in [1, 3]:
return False
if not all(token.isdigit() for token in tokens):
return False
prior_token_len = len(tokens)
if prior_token_len == 1:
return True
else:
return False
return False
Loading

0 comments on commit 635a792

Please sign in to comment.