
import tempfile
import shutil

from q2_types.testing import TestPluginBase


class FeatureClassifierTestPluginBase(TestPluginBase):
    def setUp(self):
        try:
            from q2_feature_classifier.plugin_setup import plugin
        except ImportError:
            self.fail("Could not import plugin object.")

        self.plugin = plugin

        self.temp_dir = tempfile.TemporaryDirectory(
            prefix='q2-feature-classifier-test-temp-')

    def _setup_dir(self, filenames, dirfmt):
        for filename in filenames:
            filepath = self.get_data_path(filename)
            shutil.copy(filepath, self.temp_dir.name)

        return dirfmt(self.temp_dir.name, mode='r')


import tempfile
import shutil

from qiime.plugin.testing import TestPluginBase


class FeatureClassifierTestPluginBase(TestPluginBase):
    def setUp(self):
        try:
            from q2_feature_classifier.plugin_setup import plugin
        except ImportError:
            self.fail("Could not import plugin object.")

        self.plugin = plugin

        self.temp_dir = tempfile.TemporaryDirectory(
            prefix='q2-feature-classifier-test-temp-')

    def _setup_dir(self, filenames, dirfmt):
        for filename in filenames:
            filepath = self.get_data_path(filename)
            shutil.copy(filepath, self.temp_dir.name)

        return dirfmt(self.temp_dir.name, mode='r')

Update import location of TestPluginBase
TST: Update import location of TestPluginBase

  
  import tempfile
  import shutil
  
- from q2_types.testing import TestPluginBase
+ from qiime.plugin.testing import TestPluginBase
  
  
  class FeatureClassifierTestPluginBase(TestPluginBase):
      def setUp(self):
          try:
              from q2_feature_classifier.plugin_setup import plugin
          except ImportError:
              self.fail("Could not import plugin object.")
  
          self.plugin = plugin
  
          self.temp_dir = tempfile.TemporaryDirectory(
              prefix='q2-feature-classifier-test-temp-')
  
      def _setup_dir(self, filenames, dirfmt):
          for filename in filenames:
              filepath = self.get_data_path(filename)
              shutil.copy(filepath, self.temp_dir.name)
  
          return dirfmt(self.temp_dir.name, mode='r')
  
Update import location of TestPluginBase
## Code Before:

import tempfile
import shutil

from q2_types.testing import TestPluginBase


class FeatureClassifierTestPluginBase(TestPluginBase):
    def setUp(self):
        try:
            from q2_feature_classifier.plugin_setup import plugin
        except ImportError:
            self.fail("Could not import plugin object.")

        self.plugin = plugin

        self.temp_dir = tempfile.TemporaryDirectory(
            prefix='q2-feature-classifier-test-temp-')

    def _setup_dir(self, filenames, dirfmt):
        for filename in filenames:
            filepath = self.get_data_path(filename)
            shutil.copy(filepath, self.temp_dir.name)

        return dirfmt(self.temp_dir.name, mode='r')

## Instruction:
Update import location of TestPluginBase
## Code After:

import tempfile
import shutil

from qiime.plugin.testing import TestPluginBase


class FeatureClassifierTestPluginBase(TestPluginBase):
    def setUp(self):
        try:
            from q2_feature_classifier.plugin_setup import plugin
        except ImportError:
            self.fail("Could not import plugin object.")

        self.plugin = plugin

        self.temp_dir = tempfile.TemporaryDirectory(
            prefix='q2-feature-classifier-test-temp-')

    def _setup_dir(self, filenames, dirfmt):
        for filename in filenames:
            filepath = self.get_data_path(filename)
            shutil.copy(filepath, self.temp_dir.name)

        return dirfmt(self.temp_dir.name, mode='r')
