예제 #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)
예제 #2
0
파일: test_api.py 프로젝트: mattstibbs/opal
 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)