# Path: q2_types/feature_data/_format.py
# class TaxonomyFormat(model.TextFileFormat):
# class HeaderlessTSVTaxonomyFormat(TaxonomyFormat):
# class TSVTaxonomyFormat(model.TextFileFormat):
# class FASTAFormat(model.TextFileFormat):
# class AlignedFASTAFormatMixin:
# class DNAFASTAFormat(FASTAFormat):
# class RNAFASTAFormat(FASTAFormat):
# class PairedDNASequencesDirectoryFormat(model.DirectoryFormat):
# class PairedRNASequencesDirectoryFormat(model.DirectoryFormat):
# class AlignedDNAFASTAFormat(AlignedFASTAFormatMixin, DNAFASTAFormat):
# class AlignedRNAFASTAFormat(AlignedFASTAFormatMixin, RNAFASTAFormat):
# class DifferentialFormat(model.TextFileFormat):
# class ProteinFASTAFormat(FASTAFormat):
# class AlignedProteinFASTAFormat(AlignedFASTAFormatMixin, ProteinFASTAFormat):
# class BLAST6Format(model.TextFileFormat):
#     def sniff(self):
#     def _check_n_records(self, n=None):
#     def _validate_(self, level):
#     def __init__(self, *args, **kwargs):
#     def _validate_(self, level):
#     def _validate_FASTA(self, level, FASTAValidator=None, ValidationSet=None):
#     def _turn_into_alignment(self):
#     def _validate_line_lengths(
#             self, seq_len, prev_seq_len, prev_seq_start_line):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
# def _construct_validator_from_alphabet(alphabet_str):
#     def validate(self, *args):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def validate(self, *args):
#     HEADER = ['Feature ID', 'Taxon']


import os
import os.path
import shutil
import unittest
from q2_types.feature_data import (
    TaxonomyFormat, TaxonomyDirectoryFormat, HeaderlessTSVTaxonomyFormat,
    HeaderlessTSVTaxonomyDirectoryFormat, TSVTaxonomyFormat,
    TSVTaxonomyDirectoryFormat, DNAFASTAFormat, DNASequencesDirectoryFormat,
    PairedDNASequencesDirectoryFormat, AlignedDNAFASTAFormat,
    AlignedDNASequencesDirectoryFormat, DifferentialDirectoryFormat,
    ProteinFASTAFormat, AlignedProteinFASTAFormat, FASTAFormat,
    AlignedProteinSequencesDirectoryFormat, ProteinSequencesDirectoryFormat,
    RNAFASTAFormat, RNASequencesDirectoryFormat, AlignedRNAFASTAFormat,
    AlignedRNASequencesDirectoryFormat, BLAST6DirectoryFormat
)
from qiime2.plugin.testing import TestPluginBase
from qiime2.plugin import ValidationError

    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_directory_format(self):
        # Basic test to verify that single-file directory format is working.
        filepath = self.get_data_path(os.path.join('taxonomy', '2-column.tsv'))
        shutil.copy(filepath,
                    os.path.join(self.temp_dir.name, 'taxonomy.tsv'))

        format = TSVTaxonomyDirectoryFormat(self.temp_dir.name, mode='r')

        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:

# Path: q2_types/feature_data/_format.py
# class TaxonomyFormat(model.TextFileFormat):
# class HeaderlessTSVTaxonomyFormat(TaxonomyFormat):
# class TSVTaxonomyFormat(model.TextFileFormat):
# class FASTAFormat(model.TextFileFormat):
# class AlignedFASTAFormatMixin:
# class DNAFASTAFormat(FASTAFormat):
# class RNAFASTAFormat(FASTAFormat):
# class PairedDNASequencesDirectoryFormat(model.DirectoryFormat):
# class PairedRNASequencesDirectoryFormat(model.DirectoryFormat):
# class AlignedDNAFASTAFormat(AlignedFASTAFormatMixin, DNAFASTAFormat):
# class AlignedRNAFASTAFormat(AlignedFASTAFormatMixin, RNAFASTAFormat):
# class DifferentialFormat(model.TextFileFormat):
# class ProteinFASTAFormat(FASTAFormat):
# class AlignedProteinFASTAFormat(AlignedFASTAFormatMixin, ProteinFASTAFormat):
# class BLAST6Format(model.TextFileFormat):
#     def sniff(self):
#     def _check_n_records(self, n=None):
#     def _validate_(self, level):
#     def __init__(self, *args, **kwargs):
#     def _validate_(self, level):
#     def _validate_FASTA(self, level, FASTAValidator=None, ValidationSet=None):
#     def _turn_into_alignment(self):
#     def _validate_line_lengths(
#             self, seq_len, prev_seq_len, prev_seq_start_line):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
# def _construct_validator_from_alphabet(alphabet_str):
#     def validate(self, *args):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def validate(self, *args):
#     HEADER = ['Feature ID', 'Taxon']


# Path: q2_types/feature_data/tests/test_format.py
import os
import os.path
import shutil
import unittest
from q2_types.feature_data import (
    TaxonomyFormat, TaxonomyDirectoryFormat, HeaderlessTSVTaxonomyFormat,
    HeaderlessTSVTaxonomyDirectoryFormat, TSVTaxonomyFormat,
    TSVTaxonomyDirectoryFormat, DNAFASTAFormat, DNASequencesDirectoryFormat,
    PairedDNASequencesDirectoryFormat, AlignedDNAFASTAFormat,
    AlignedDNASequencesDirectoryFormat, DifferentialDirectoryFormat,
    ProteinFASTAFormat, AlignedProteinFASTAFormat, FASTAFormat,
    AlignedProteinSequencesDirectoryFormat, ProteinSequencesDirectoryFormat,
    RNAFASTAFormat, RNASequencesDirectoryFormat, AlignedRNAFASTAFormat,
    AlignedRNASequencesDirectoryFormat, BLAST6DirectoryFormat
)
from qiime2.plugin.testing import TestPluginBase
from qiime2.plugin import ValidationError


    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_directory_format(self):
        # Basic test to verify that single-file directory format is working.
        filepath = self.get_data_path(os.path.join('taxonomy', '2-column.tsv'))
        shutil.copy(filepath,
                    os.path.join(self.temp_dir.name, 'taxonomy.tsv'))

        format = TSVTaxonomyDirectoryFormat(self.temp_dir.name, mode='r')

        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')