# Path: q2_types/distance_matrix/_format.py
# class LSMatFormat(model.TextFileFormat):
#     def sniff(self):


import os.path
import shutil
import unittest
from q2_types.distance_matrix import LSMatFormat, DistanceMatrixDirectoryFormat
from qiime2.plugin.testing import TestPluginBase
from qiime2.plugin import ValidationError
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2021, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------




class TestFormats(TestPluginBase):
    package = 'q2_types.distance_matrix.tests'

    def test_lsmat_format_validate_positive(self):
        filenames = ('distance-matrix-1x1.tsv', 'distance-matrix-2x2.tsv',
                     'distance-matrix-NxN.tsv')
        for filename in filenames:
            filepath = self.get_data_path(filename)
            format = LSMatFormat(filepath, mode='r')

            # Should not error.
            format.validate()

    def test_lsmat_format_validate_negative(self):
        filepath = self.get_data_path('not-lsmat')

# Path: q2_types/distance_matrix/_format.py
# class LSMatFormat(model.TextFileFormat):
#     def sniff(self):


# Path: q2_types/distance_matrix/tests/test_format.py
import os.path
import shutil
import unittest
from q2_types.distance_matrix import LSMatFormat, DistanceMatrixDirectoryFormat
from qiime2.plugin.testing import TestPluginBase
from qiime2.plugin import ValidationError

# ----------------------------------------------------------------------------
# Copyright (c) 2016-2021, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------




class TestFormats(TestPluginBase):
    package = 'q2_types.distance_matrix.tests'

    def test_lsmat_format_validate_positive(self):
        filenames = ('distance-matrix-1x1.tsv', 'distance-matrix-2x2.tsv',
                     'distance-matrix-NxN.tsv')
        for filename in filenames:
            filepath = self.get_data_path(filename)
            format = LSMatFormat(filepath, mode='r')

            # Should not error.
            format.validate()

    def test_lsmat_format_validate_negative(self):
        filepath = self.get_data_path('not-lsmat')

        format = LSMatFormat(filepath, mode='r')