Skip to content

Commit

Permalink
SQUASH: Addressing @ebolyen's review
Browse files Browse the repository at this point in the history
  • Loading branch information
Oddant1 committed Aug 16, 2019
1 parent a9d0a39 commit 1744618
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions q2_types/feature_data/_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ def _validate_lines(self, max_lines):
return
if first[0] != ord(b'>'):
raise ValidationError("First line of file is not a valid "
"refline. reflines must start with "
"'>'")
"description. Descriptions must "
"start with '>'")
fh.seek(0)
for line_number, line in enumerate(fh, 1):
if line_number >= max_lines:
Expand All @@ -160,13 +160,13 @@ def _validate_lines(self, max_lines):
if line.startswith('>'):
if last_line_was_ID:
raise ValidationError('Multiple consecutive '
'reflines starting on line '
f'{line_number-1!r}')
'descriptions starting on '
f'line {line_number-1!r}')
line = line.split()
if line[0] == '>':
if len(line) == 1:
raise ValidationError(
f'Refline on line {line_number} is '
f'Description on line {line_number} is '
'missing an ID.')
else:
raise ValidationError(
Expand Down
2 changes: 1 addition & 1 deletion q2_types/feature_data/tests/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def test_dna_fasta_format_consecutive_IDs(self):
format = DNAFASTAFormat(filepath, mode='r')

with self.assertRaisesRegex(
ValidationError, 'consecutive reflines.*1'):
ValidationError, 'consecutive descriptions.*1'):
format.validate()

def test_dna_fasta_format_missing_initial_ID(self):
Expand Down

0 comments on commit 1744618

Please sign in to comment.