def test_fail_create_query_string(params, empty, expected_results):
    """
    Given:
        - En empty dictionary of params

    When:
        - running commands using filter arguments

    Then:
        - validating the function fails

    """
    from CarbonBlackResponseV2 import _create_query_string
    from CommonServerPython import DemistoException

    with pytest.raises(DemistoException) as e:
        _create_query_string(params, allow_empty_params=empty)
    assert str(e.value) == expected_results
def test_create_query_string(params, empty, expected_results):
    """
    Given:
        - A search task's parameters

    When:
        - running commands using filter arguments

    Then:
        - validating the query string containing the params

    """
    from CarbonBlackResponseV2 import _create_query_string

    query_string = _create_query_string(params, allow_empty_params=empty)

    assert query_string == expected_results