Пример #1
0
    def test_get_enabled_tabs(self, get_available_plugins):
        """Verify that only enabled tabs are retrieved."""
        enabled_tab = self._mock_tab(is_enabled=True)
        mock_tabs = {
            'disabled_tab': self._mock_tab(),
            'enabled_tab': enabled_tab,
        }

        get_available_plugins.return_value = mock_tabs

        self.assertEqual(StudioTabPluginManager.get_enabled_tabs(), [enabled_tab])
Пример #2
0
    def test_get_enabled_tabs(self, get_available_plugins):
        """Verify that only enabled tabs are retrieved."""
        enabled_tab = self._mock_tab(is_enabled=True)
        mock_tabs = {
            'disabled_tab': self._mock_tab(),
            'enabled_tab': enabled_tab,
        }

        get_available_plugins.return_value = mock_tabs

        self.assertEqual(StudioTabPluginManager.get_enabled_tabs(),
                         [enabled_tab])
Пример #3
0
 def test_get_invalid_plugin(self):
     """Verify that get_plugin fails when an invalid plugin is requested."""
     with self.assertRaises(PluginError):
         StudioTabPluginManager.get_plugin('invalid_tab')
Пример #4
0
 def test_get_invalid_plugin(self):
     """Verify that get_plugin fails when an invalid plugin is requested."""
     with self.assertRaises(PluginError):
         StudioTabPluginManager.get_plugin('invalid_tab')