Esempio n. 1
0
def test_usergroup_create(conn_args, query_return, mock_login):
    """
    query_submitted = {"params": {"name": "testgroup"}, "jsonrpc": "2.0", "id": 0,
    "auth": "7f3ac5e90201e5de4eb19e5322606575", "method": "usergroup.create"}
    """

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

    assert zabbix.usergroup_create("testgroup", **conn_args) == module_return
Esempio n. 2
0
    def test_usergroup_create(self):
        '''
        query_submitted = {"params": {"name": "testgroup"}, "jsonrpc": "2.0", "id": 0,
        "auth": "7f3ac5e90201e5de4eb19e5322606575", "method": "usergroup.create"}
        '''

        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_create('testgroup', **CONN_ARGS), module_return)