예제 #1
0
def test_unparse(query):
    result = parser.unparse(query)

    # We can't trivially test that the output is exactly what we expect,
    # because of uncertainty in the ordering of keys. Instead, we check that
    # parsing the result gives us an object equal to the original query.
    assert parser.parse(result) == query
def test_unparse(query):
    result = parser.unparse(query)

    # We can't trivially test that the output is exactly what we expect,
    # because of uncertainty in the ordering of keys. Instead, we check that
    # parsing the result gives us an object equal to the original query.
    assert parser.parse(result) == query
예제 #3
0
파일: activity.py 프로젝트: kaydoh/h
def _parsed_query(request):
    """
    Return the parsed (MultiDict) query from the given request.

    Return a copy of the given search page request's search query, parsed from
    a string into a MultiDict.

    """
    return parser.parse(request.params.get("q", ""))
예제 #4
0
파일: activity.py 프로젝트: gnott/h
def _parsed_query(request):
    """
    Return the parsed (MultiDict) query from the given request.

    Return a copy of the given search page request's search query, parsed from
    a string into a MultiDict.

    """
    return parser.parse(request.params.get('q', ''))
def test_parse(query_in, query_out):
    assert parser.parse(query_in) == query_out
def test_parse_with_any_nonwhitespace_text(kw, value):
    result = parser.parse(kw + ":" + value)
    assert result.get(kw) == value
def test_parse_always_return_a_multidict(text):
    """Given any string input, output should always be a MultiDict."""
    result = parser.parse(text)
    assert isinstance(result, MultiDict)
def test_parse_with_odd_quotes_combinations(query_in, query_out):
    assert parser.parse(query_in) == query_out
예제 #9
0
def test_parse_with_odd_quotes_combinations(query_in, query_out):
    assert parser.parse(query_in) == query_out
예제 #10
0
def test_parse(query_in, query_out):
    assert parser.parse(query_in) == query_out
예제 #11
0
def test_parse_with_any_nonwhitespace_text(kw, value):
    result = parser.parse(kw + ':' + value)
    assert result.get(kw) == value
예제 #12
0
def test_parse_always_return_a_multidict(text):
    """Given any string input, output should always be a MultiDict."""
    result = parser.parse(text)
    assert isinstance(result, MultiDict)