Esempio n. 1
0
 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)
Esempio n. 2
0
 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)