summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Roztocil <jakub@roztocil.co>2021-02-06 10:52:22 +0100
committerJakub Roztocil <jakub@roztocil.co>2021-02-06 10:52:30 +0100
commit1ac8f696512138fa70eef387b75657b726d6308e (patch)
tree9864088a3549ac41f269d6ff104d68bbebb37fa0
parent3c07a2532647f64a4aaa7c729557fee5dcc2e182 (diff)
Add more output matching tests
-rw-r--r--tests/test_tokens.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/test_tokens.py b/tests/test_tokens.py
index 60af01e5..65e72481 100644
--- a/tests/test_tokens.py
+++ b/tests/test_tokens.py
@@ -63,6 +63,31 @@ def test_terminal_headers_and_body():
assert_output_matches(r, TERMINAL_REQUEST)
+def test_terminal_request_headers_response_body(httpbin):
+ r = http('--print=Hb', httpbin + '/get')
+ assert_output_matches(r, TERMINAL_REQUEST)
+
+
+def test_raw_request_headers_response_body(httpbin):
+ r = http('--print=Hb', httpbin + '/get', env=MockEnvironment(stdout_isatty=False))
+ assert_output_matches(r, RAW_REQUEST)
+
+
+def test_terminal_request_headers_response_headers(httpbin):
+ r = http('--print=Hh', httpbin + '/get')
+ assert_output_matches(r, [Expect.REQUEST_HEADERS, Expect.RESPONSE_HEADERS])
+
+
+def test_raw_request_headers_response_headers(httpbin):
+ r = http('--print=Hh', httpbin + '/get')
+ assert_output_matches(r, [Expect.REQUEST_HEADERS, Expect.RESPONSE_HEADERS])
+
+
+def test_terminal_request_body_response_body(httpbin):
+ r = http('--print=Hh', httpbin + '/get')
+ assert_output_matches(r, [Expect.REQUEST_HEADERS, Expect.RESPONSE_HEADERS])
+
+
def test_raw_headers_and_body():
r = http(
'--print=HB', '--offline', 'pie.dev', 'AAA=BBB',
@@ -109,3 +134,8 @@ def test_verbose_chunked():
assert HTTP_OK in r
assert 'Transfer-Encoding: chunked' in r
assert_output_matches(r, TERMINAL_EXCHANGE)
+
+
+def test_request_headers_response_body(httpbin):
+ r = http('--print=Hb', httpbin + '/get')
+ assert_output_matches(r, TERMINAL_REQUEST)