Ejemplo n.º 1
0
def test_usergroup_update(conn_args, query_return, mock_login):
    """
    query_submitted = {"params": {"usrgrpid": 13, "users_status": 1}, "jsonrpc": "2.0",
    "id": 0, "auth": "ef772237245f59f655871bc8fbbcd67c", "method": "usergroup.update"}
    """

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

    assert zabbix.usergroup_update("13", users_status="1", **conn_args) == module_return
Ejemplo n.º 2
0
    def test_usergroup_update(self):
        '''
        query_submitted = {"params": {"usrgrpid": 13, "users_status": 1}, "jsonrpc": "2.0",
        "id": 0, "auth": "ef772237245f59f655871bc8fbbcd67c", "method": "usergroup.update"}
        '''

        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_update('13', users_status='1', **CONN_ARGS), module_return)