def test_tsv_taxonomy_format_validate_positive(self): filenames = ['2-column.tsv', '3-column.tsv', 'valid-but-messy.tsv', 'many-rows.tsv'] filepaths = [self.get_data_path(os.path.join('taxonomy', filename)) for filename in filenames] for filepath in filepaths: format = TSVTaxonomyFormat(filepath, mode='r') format.validate()
def test_tsv_taxonomy_format_validate_positive(self): filenames = ['2-column.tsv', '3-column.tsv', 'valid-but-messy.tsv', 'many-rows.tsv'] filepaths = [self.get_data_path(os.path.join('taxonomy', filename)) for filename in filenames] for filepath in filepaths: format = TSVTaxonomyFormat(filepath, mode='r') format.validate()
def test_tsv_taxonomy_format_validate_negative(self): filenames = ['empty', 'blanks', '1-column.tsv', 'headerless.tsv', 'header-only.tsv', 'jagged.tsv'] filepaths = [self.get_data_path(os.path.join('taxonomy', filename)) for filename in filenames] for filepath in filepaths: format = TSVTaxonomyFormat(filepath, mode='r') with self.assertRaisesRegex(ValidationError, 'TSVTaxonomy'): format.validate()
def test_tsv_taxonomy_format_validate_negative(self): filenames = ['empty', 'blanks-and-comments', '1-column.tsv', 'headerless.tsv', 'header-only.tsv', 'jagged.tsv'] filepaths = [self.get_data_path(os.path.join('taxonomy', filename)) for filename in filenames] for filepath in filepaths: format = TSVTaxonomyFormat(filepath, mode='r') with self.assertRaisesRegex(ValidationError, 'TSVTaxonomy'): format.validate()
def test_tsv_taxonomy_format_column_header_lengths(self): filenames = ['greater-column-length.tsv', 'greater-header-length.tsv'] filepaths = [self.get_data_path(os.path.join('taxonomy', filename)) for filename in filenames] for filepath in filepaths: format = TSVTaxonomyFormat(filepath, mode='r') with self.assertRaisesRegex(ValidationError, 'line 2.*3 values.*expected 2'): format.validate()