def test_distpach_calls_release(self, m_stdin, m_release): # Load stdin.read to return input string input = {"args": {}, "command": "release"} m_stdin.read.return_value = json.dumps(input) # Call function calico_mesos.calico_mesos() m_release.assert_called_with(input["args"])
def test_distpach_calls_isolate(self, m_stdin, m_isolate): # Load stdin.read to return input string args = {"args": {}, "command": "isolate"} m_stdin.read.return_value = json.dumps(args) # Call function calico_mesos.calico_mesos() self.assertTrue(m_isolate.called)
def test_dispatch_catches_errors(self, args, error, m_stdin): m_stdin.read.return_value = json.dumps(args) results = calico_mesos.calico_mesos() self.assertEqual(results, error_message(error))