提交 b3ec1d0c 编写于 作者: C Cleber Rosa

Plugin interfaces: port to Python 3 ABC syntax

And test that the interface (only) classes can not be used directly.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 fa3a4754
...@@ -16,9 +16,7 @@ ...@@ -16,9 +16,7 @@
import abc import abc
class Plugin: class Plugin(metaclass=abc.ABCMeta):
__metaclass__ = abc.ABCMeta
""" """
Base for all plugins Base for all plugins
......
import unittest
from avocado.core import plugin_interfaces
class Plugin(unittest.TestCase):
def test_instantiate_settings(self):
with self.assertRaises(TypeError):
# pylint: disable=E0110
plugin_interfaces.Settings()
def test_instantiate_cli(self):
with self.assertRaises(TypeError):
# pylint: disable=E0110
plugin_interfaces.CLI()
def test_instantiate_cli_cmd(self):
with self.assertRaises(TypeError):
# pylint: disable=E0110
plugin_interfaces.CLICmd()
def test_instantiate_job_pre(self):
with self.assertRaises(TypeError):
# pylint: disable=E0110
plugin_interfaces.JobPre()
def test_instantiate_job_post(self):
with self.assertRaises(TypeError):
# pylint: disable=E0110
plugin_interfaces.JobPost()
def test_instantiate_result(self):
with self.assertRaises(TypeError):
# pylint: disable=E0110
plugin_interfaces.Result()
def test_instantiate_job_pre_tests(self):
with self.assertRaises(TypeError):
# pylint: disable=E0110
plugin_interfaces.JobPreTests()
def test_instantiate_job_post_tests(self):
with self.assertRaises(TypeError):
# pylint: disable=E0110
plugin_interfaces.JobPostTests()
def test_instantiate_result_events(self):
with self.assertRaises(TypeError):
# pylint: disable=E0110
plugin_interfaces.ResultEvents()
def test_instantiate_varianter(self):
with self.assertRaises(TypeError):
# pylint: disable=E0110
plugin_interfaces.Varianter()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册