aboutsummaryrefslogtreecommitdiffstats
path: root/test/pathod/test_language_actions.py
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2016-06-17 14:15:48 +0200
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2016-06-17 15:06:01 +0200
commiteb3ed87100ff7c32e5bf040db7eb6ea3d0c06e12 (patch)
tree7a4b871c24193d31f8dc23794b0a37f58c111c92 /test/pathod/test_language_actions.py
parentfcf5dc8728816bae73a175ee021f8a11a1591567 (diff)
downloadmitmproxy-eb3ed87100ff7c32e5bf040db7eb6ea3d0c06e12.tar.gz
mitmproxy-eb3ed87100ff7c32e5bf040db7eb6ea3d0c06e12.tar.bz2
mitmproxy-eb3ed87100ff7c32e5bf040db7eb6ea3d0c06e12.zip
move custom HTTP/2 stack from netlib to pathod
Diffstat (limited to 'test/pathod/test_language_actions.py')
-rw-r--r--test/pathod/test_language_actions.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/test/pathod/test_language_actions.py b/test/pathod/test_language_actions.py
index f12d8105..2b1b6915 100644
--- a/test/pathod/test_language_actions.py
+++ b/test/pathod/test_language_actions.py
@@ -1,11 +1,10 @@
from six import BytesIO
-from pathod.language import actions
-from pathod import language
+from pathod.language import actions, parse_pathoc, parse_pathod, serve
def parse_request(s):
- return next(language.parse_pathoc(s))
+ return next(parse_pathoc(s))
def test_unique_name():
@@ -16,9 +15,9 @@ def test_unique_name():
class TestDisconnects:
def test_parse_pathod(self):
- a = next(language.parse_pathod("400:d0")).actions[0]
+ a = next(parse_pathod("400:d0")).actions[0]
assert a.spec() == "d0"
- a = next(language.parse_pathod("400:dr")).actions[0]
+ a = next(parse_pathod("400:dr")).actions[0]
assert a.spec() == "dr"
def test_at(self):
@@ -42,12 +41,12 @@ class TestDisconnects:
class TestInject:
def test_parse_pathod(self):
- a = next(language.parse_pathod("400:ir,@100")).actions[0]
+ a = next(parse_pathod("400:ir,@100")).actions[0]
assert a.offset == "r"
assert a.value.datatype == "bytes"
assert a.value.usize == 100
- a = next(language.parse_pathod("400:ia,@100")).actions[0]
+ a = next(parse_pathod("400:ia,@100")).actions[0]
assert a.offset == "a"
def test_at(self):
@@ -62,8 +61,8 @@ class TestInject:
def test_serve(self):
s = BytesIO()
- r = next(language.parse_pathod("400:i0,'foo'"))
- assert language.serve(r, s, {})
+ r = next(parse_pathod("400:i0,'foo'"))
+ assert serve(r, s, {})
def test_spec(self):
e = actions.InjectAt.expr()
@@ -96,7 +95,7 @@ class TestPauses:
assert v.offset == "a"
def test_request(self):
- r = next(language.parse_pathod('400:p10,10'))
+ r = next(parse_pathod('400:p10,10'))
assert r.actions[0].spec() == "p10,10"
def test_spec(self):