Пример #1
0
    def test_list_configured_members(self):
        '''
        Test for return a list of member workers from the configuration files
        '''
        with patch.object(modjk, '_do_http', return_value={}):
            self.assertListEqual(modjk.list_configured_members('loadbalancer1'),
                                 [])

        with patch.object(modjk, '_do_http', return_value=
                          {'worker.loadbalancer1.balance_workers': 'SALT'}):
            self.assertListEqual(modjk.list_configured_members('loadbalancer1'),
                                 ['SALT'])
Пример #2
0
    def test_list_configured_members(self):
        '''
        Test for return a list of member workers from the configuration files
        '''
        with patch.object(modjk, '_do_http', return_value={}):
            self.assertListEqual(modjk.list_configured_members('loadbalancer1'),
                                 [])

        with patch.object(modjk, '_do_http', return_value=
                          {'worker.loadbalancer1.balance_workers': 'SALT'}):
            self.assertListEqual(modjk.list_configured_members('loadbalancer1'),
                                 ['SALT'])
Пример #3
0
def test_list_configured_members():
    """
    Test for return a list of member workers from the configuration files
    """
    with patch.object(modjk, "_do_http", return_value={}):
        assert modjk.list_configured_members("loadbalancer1") == []

    with patch.object(
            modjk,
            "_do_http",
            return_value={"worker.loadbalancer1.balance_workers": "SALT"},
    ):
        assert modjk.list_configured_members("loadbalancer1") == ["SALT"]