Ejemplo n.º 1
0
    def test_worker_status(self):
        '''
        Test for return the state of the worker
        '''
        with patch.object(modjk, '_do_http', return_value=
                          {'worker.node1.activation': 'ACT',
                           'worker.node1.state': 'OK'}):
            self.assertDictEqual(modjk.worker_status("node1"),
                                 {'activation': 'ACT', 'state': 'OK'})

        with patch.object(modjk, '_do_http', return_value={}):
            self.assertFalse(modjk.worker_status("node1"))
Ejemplo n.º 2
0
    def test_worker_status(self):
        '''
        Test for return the state of the worker
        '''
        with patch.object(modjk, '_do_http', return_value=
                          {'worker.node1.activation': 'ACT',
                           'worker.node1.state': 'OK'}):
            self.assertDictEqual(modjk.worker_status("node1"),
                                 {'activation': 'ACT', 'state': 'OK'})

        with patch.object(modjk, '_do_http', return_value={}):
            self.assertFalse(modjk.worker_status("node1"))
Ejemplo n.º 3
0
def test_worker_status():
    """
    Test for return the state of the worker
    """
    with patch.object(
            modjk,
            "_do_http",
            return_value={
                "worker.node1.activation": "ACT",
                "worker.node1.state": "OK"
            },
    ):
        assert modjk.worker_status("node1") == {
            "activation": "ACT",
            "state": "OK"
        }

    with patch.object(modjk, "_do_http", return_value={}):
        assert not modjk.worker_status("node1")
Ejemplo n.º 4
0
    def test_worker_status(self):
        """
        Test for return the state of the worker
        """
        with patch.object(
                modjk,
                "_do_http",
                return_value={
                    "worker.node1.activation": "ACT",
                    "worker.node1.state": "OK"
                },
        ):
            self.assertDictEqual(modjk.worker_status("node1"), {
                "activation": "ACT",
                "state": "OK"
            })

        with patch.object(modjk, "_do_http", return_value={}):
            self.assertFalse(modjk.worker_status("node1"))