コード例 #1
0
def test_quote():
    """
    Adding test for INT-3117 - working with URLs and reference sets causes an error.
    The issue is that forward slash doesn't get replaced by urllib.quote, and it causes issue with URL routing.
    """
    from six.moves.urllib_parse import quote as urlquote
    assert (qradar_utils.quote("/") == urlquote(qradar_utils.FORWARD_SLASH))

    test_val = "å∫ç∂´ƒ:_%^.abcdef1234"
    assert qradar_utils.quote(test_val) == urlquote(test_val)
コード例 #2
0
def test_quote_passing_args(mocked_func):
    qradar_utils.quote("test")
    mocked_func.assert_called_with("test".encode("utf-8"))

    qradar_utils.quote("test", "test")
    mocked_func.assert_called_with("test".encode("utf-8"), "test")
コード例 #3
0
def test_quote_return(val):
    result = qradar_utils.quote(val)
    assert isinstance(result, six.string_types)