From 3e0cd6442aa3dd5ecc08af4851e68545121737ab Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 29 Oct 2012 17:33:10 +1300 Subject: Add .spec methods for Request and Response objects. --- test/test_language.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/test_language.py') diff --git a/test/test_language.py b/test/test_language.py index c453766c..219b2909 100644 --- a/test/test_language.py +++ b/test/test_language.py @@ -406,6 +406,13 @@ class TestParseRequest: assert r.path.string().endswith("bar") assert r.actions + def test_spec(self): + def rt(s): + s = language.parse_request({}, s).spec() + assert language.parse_request({}, s).spec() == s + rt("get:/foo") + rt("get:/foo:da") + class TestParseResponse: def test_parse_err(self): @@ -439,6 +446,14 @@ class TestParseResponse: r = language.parse_response({}, "400:b@100g") assert r.length({}, None) + def test_spec(self): + def rt(s): + s = language.parse_response({}, s).spec() + assert language.parse_response({}, s).spec() == s + rt("400:b@100g") + rt("400") + rt("400:da") + class TestWriteValues: def test_send_chunk(self): -- cgit v1.2.3