예제 #1
0
    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"])
예제 #2
0
    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"])
예제 #3
0
    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)
예제 #4
0
    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)
예제 #5
0
 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))
예제 #6
0
 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))