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


import shutil
import unittest
from q2_types.tree import NewickFormat, NewickDirectoryFormat
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.tree.tests"

    def test_newick_format_validate_positive(self):
        filepath = self.get_data_path('tree.nwk')
        format = NewickFormat(filepath, mode='r')

        format.validate()

    def test_newick_format_validate_negative(self):
        filepath = self.get_data_path('not-tree.nwk')

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


# Path: q2_types/tree/tests/test_format.py
import shutil
import unittest
from q2_types.tree import NewickFormat, NewickDirectoryFormat
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.tree.tests"

    def test_newick_format_validate_positive(self):
        filepath = self.get_data_path('tree.nwk')
        format = NewickFormat(filepath, mode='r')

        format.validate()

    def test_newick_format_validate_negative(self):
        filepath = self.get_data_path('not-tree.nwk')

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