Ejemplo n.º 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"])
Ejemplo n.º 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"])
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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))
Ejemplo n.º 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))