Py3: Fix useragent tests
This commit is contained in:
parent
78b2fa3a13
commit
40056e1cd7
|
@ -301,18 +301,18 @@ def test_shortcuts():
|
||||||
assert next(language.parse_pathod(
|
assert next(language.parse_pathod(
|
||||||
"400:l'foo'")).headers[0].key.val == b"Location"
|
"400:l'foo'")).headers[0].key.val == b"Location"
|
||||||
|
|
||||||
assert "Android" in tutils.render(parse_request("get:/:ua"))
|
assert b"Android" in tutils.render(parse_request("get:/:ua"))
|
||||||
assert "User-Agent" in tutils.render(parse_request("get:/:ua"))
|
assert b"User-Agent" in tutils.render(parse_request("get:/:ua"))
|
||||||
|
|
||||||
|
|
||||||
def test_user_agent():
|
def test_user_agent():
|
||||||
e = http.ShortcutUserAgent.expr()
|
e = http.ShortcutUserAgent.expr()
|
||||||
v = e.parseString("ua")[0]
|
v = e.parseString("ua")[0]
|
||||||
assert "Android" in v.string()
|
assert b"Android" in v.string()
|
||||||
|
|
||||||
e = http.ShortcutUserAgent.expr()
|
e = http.ShortcutUserAgent.expr()
|
||||||
v = e.parseString("u'a'")[0]
|
v = e.parseString("u'a'")[0]
|
||||||
assert "Android" not in v.string()
|
assert b"Android" not in v.string()
|
||||||
|
|
||||||
v = e.parseString("u@100'")[0]
|
v = e.parseString("u@100'")[0]
|
||||||
assert len(str(v.freeze({}).value)) > 100
|
assert len(str(v.freeze({}).value)) > 100
|
||||||
|
|
Loading…
Reference in New Issue