def test_on_methods_must_not_do_anything(self):
        data_mock = Mock()

        # Simple test to verify that all methods starting with "on_" prefix must not implement any functionality
        plugin = BasePlugin("name")

        # Add every on_ method here
        plugin.on_before_transform_resource(data_mock, data_mock, data_mock)

        # `method_calls` tracks calls to the mock, its methods, attributes, and *their* methods & attributes
        self.assertEquals([], data_mock.method_calls)
Ejemplo n.º 2
0
    def test_on_methods_must_not_do_anything(self):
        data_mock = Mock()

        # Simple test to verify that all methods starting with "on_" prefix must not implement any functionality
        plugin = BasePlugin("name")

        # Add every on_ method here
        plugin.on_before_transform_resource(data_mock, data_mock, data_mock)

        # `method_calls` tracks calls to the mock, its methods, attributes, and *their* methods & attributes
        self.assertEquals([], data_mock.method_calls)
Ejemplo n.º 3
0
    def test_initialization_without_name_must_raise_exception(self):

        with self.assertRaises(ValueError):
            BasePlugin(None)
Ejemplo n.º 4
0
    def test_initialization_should_set_name(self):

        name = "some name"
        plugin = BasePlugin(name)
        self.assertEquals(name, plugin.name)