diff --git a/ckanext/validation/tests/test_interfaces.py b/ckanext/validation/tests/test_interfaces.py index 367beb45..36758352 100644 --- a/ckanext/validation/tests/test_interfaces.py +++ b/ckanext/validation/tests/test_interfaces.py @@ -14,12 +14,15 @@ class TestPlugin(p.SingletonPlugin): p.implements(IDataValidation, inherit=True) + p.implements(IPipeValidation, inherit=True) calls = 0 def reset_counter(self): self.calls = 0 + # IDataValidation + def can_validate(self, context, data_dict): self.calls += 1 @@ -36,6 +39,11 @@ def set_update_mode(self, context, data_dict, current_mode): is_async = data_dict.get('async') return settings.ASYNC_MODE if is_async else current_mode + # IPipeValidation + + def receive_validation_report(self, validation_report): + self.calls += 1 + def _get_data_plugin_calls(): for plugin in p.PluginImplementations(IDataValidation): @@ -53,6 +61,9 @@ def setup(self): for plugin in p.PluginImplementations(IDataValidation): return plugin.reset_counter() + for plugin in p.PluginImplementations(IPipeValidation): + return plugin.reset_counter() + @pytest.mark.usefixtures("clean_db", "validation_setup") @mock.patch(helpers.MOCK_SYNC_VALIDATE, return_value=helpers.VALID_REPORT)