def test_register_plugins(self, plugins): mock_plugin = MagicMock(name='Mock Plugin') mock_plugin.get_apis.return_value = [('thingapi', None)] plugins.return_value = [mock_plugin] with patch.object(api.router, 'register') as register: api.register_plugin_apis() register.assert_called_with('thingapi', None)
def test_register(self, plugins): mock_plugin = MagicMock(name='Mock Plugin') mock_plugin.get_apis.return_value = [('thingapi', None)] plugins.return_value = [mock_plugin] with patch.object(api.router, 'register') as register: api.register_plugin_apis() register.assert_called_with('thingapi', None)