Example #1
0
def test_apiinfo_version(conn_args, query_return, mock_login):
    """
    Test apiinfo_version
    """
    module_return = "3.4.5"
    query_return({"jsonrpc": "2.0", "result": "3.4.5", "id": 1})

    assert zabbix.apiinfo_version(**conn_args) == module_return
Example #2
0
    def test_apiinfo_version(self):
        """
        Test apiinfo_version
        """
        module_return = "3.4.5"
        query_return = {"jsonrpc": "2.0", "result": "3.4.5", "id": 1}

        with patch.object(zabbix, "_query", return_value=query_return):
            with patch.object(zabbix, "_login", return_value=CONN_ARGS):
                self.assertEqual(zabbix.apiinfo_version(**CONN_ARGS), module_return)