Beispiel #1
0
def test_usergroup_delete(conn_args, query_return, mock_login):
    """
    query_submitted = {"params": [13], "jsonrpc": "2.0", "id": 0,
    "auth": "9bad39de2a5a9211da588dd06dad8773", "method": "usergroup.delete"}
    """

    module_return = ["13"]
    query_return({"jsonrpc": "2.0", "result": {"usrgrpids": ["13"]}, "id": 0})

    assert zabbix.usergroup_delete("13", **conn_args) == module_return
Beispiel #2
0
    def test_usergroup_delete(self):
        '''
        query_submitted = {"params": [13], "jsonrpc": "2.0", "id": 0,
        "auth": "9bad39de2a5a9211da588dd06dad8773", "method": "usergroup.delete"}
        '''

        module_return = ['13']
        query_return = {"jsonrpc": "2.0", "result": {"usrgrpids": ["13"]}, "id": 0}

        with patch.object(zabbix, '_query', return_value=query_return):
            with patch.object(zabbix, '_login', return_value=CONN_ARGS):
                self.assertEqual(zabbix.usergroup_delete('13', **CONN_ARGS), module_return)