pytest_httpserver 1.0.11__tar.gz → 1.0.12__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/CHANGES.rst +14 -0
  2. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/PKG-INFO +1 -1
  3. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/doc/conf.py +1 -1
  4. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/pyproject.toml +1 -1
  5. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_log_querying.py +33 -24
  6. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/CONTRIBUTION.md +0 -0
  7. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/LICENSE +0 -0
  8. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/README.md +0 -0
  9. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/doc/Makefile +0 -0
  10. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/doc/_static/.placeholder +0 -0
  11. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/doc/api.rst +0 -0
  12. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/doc/background.rst +0 -0
  13. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/doc/changes.rst +0 -0
  14. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/doc/fixtures.rst +0 -0
  15. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/doc/guide.rst +0 -0
  16. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/doc/howto.rst +0 -0
  17. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/doc/index.rst +0 -0
  18. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/doc/patch.py +0 -0
  19. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/doc/tutorial.rst +0 -0
  20. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/doc/upgrade.rst +0 -0
  21. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/example.py +0 -0
  22. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/example_pytest.py +0 -0
  23. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/pytest_httpserver/__init__.py +0 -0
  24. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/pytest_httpserver/blocking_httpserver.py +0 -0
  25. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/pytest_httpserver/hooks.py +0 -0
  26. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/pytest_httpserver/httpserver.py +0 -0
  27. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/pytest_httpserver/py.typed +0 -0
  28. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/pytest_httpserver/pytest_plugin.py +0 -0
  29. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/assets/Makefile +0 -0
  30. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/assets/README +0 -0
  31. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/assets/rootCA.cnf +0 -0
  32. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/assets/rootCA.crt +0 -0
  33. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/assets/rootCA.key +0 -0
  34. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/assets/rootCA.srl +0 -0
  35. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/assets/server.cnf +0 -0
  36. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/assets/server.crt +0 -0
  37. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/assets/server.csr +0 -0
  38. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/assets/server.key +0 -0
  39. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/assets/v3.ext +0 -0
  40. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/conftest.py +0 -0
  41. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_example_blocking_httpserver.py +0 -0
  42. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_example_query_params1.py +0 -0
  43. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_example_query_params2.py +0 -0
  44. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_authorization_headers.py +0 -0
  45. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_case_insensitive_matcher.py +0 -0
  46. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_check.py +0 -0
  47. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_check_handler_errors.py +0 -0
  48. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_custom_handler.py +0 -0
  49. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_custom_hooks.py +0 -0
  50. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_header_value_matcher.py +0 -0
  51. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_hooks.py +0 -0
  52. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_json_matcher.py +0 -0
  53. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_log_querying.py +0 -0
  54. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_query_params_dict.py +0 -0
  55. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_query_params_never_do_this.py +0 -0
  56. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_query_params_proper_use.py +0 -0
  57. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_regexp.py +0 -0
  58. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_timeout_requests.py +0 -0
  59. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_url_matcher.py +0 -0
  60. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/examples/test_howto_wait_success.py +0 -0
  61. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_blocking_httpserver.py +0 -0
  62. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_handler_errors.py +0 -0
  63. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_headers.py +0 -0
  64. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_hooks.py +0 -0
  65. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_ip_protocols.py +0 -0
  66. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_json_matcher.py +0 -0
  67. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_mixed.py +0 -0
  68. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_oneshot.py +0 -0
  69. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_ordered.py +0 -0
  70. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_parse_qs.py +0 -0
  71. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_permanent.py +0 -0
  72. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_port_changing.py +0 -0
  73. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_querymatcher.py +0 -0
  74. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_querystring.py +0 -0
  75. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_release.py +0 -0
  76. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_ssl.py +0 -0
  77. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_threaded.py +0 -0
  78. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_urimatch.py +0 -0
  79. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_wait.py +0 -0
  80. {pytest_httpserver-1.0.11 → pytest_httpserver-1.0.12}/tests/test_with_statement.py +0 -0
@@ -2,6 +2,20 @@
2
2
  Release Notes
3
3
  =============
4
4
 
5
+ .. _Release Notes_1.0.12:
6
+
7
+ 1.0.12
8
+ ======
9
+
10
+ .. _Release Notes_1.0.12_Bug Fixes:
11
+
12
+ Bug Fixes
13
+ ---------
14
+
15
+ - Fix pytest-httpserver's own tests related to log querying. No functional
16
+ changes in pytest-httpserver code itself. `#345 <https://github.com/csernazs/pytest-httpserver/issues/345>`_
17
+
18
+
5
19
  .. _Release Notes_1.0.11:
6
20
 
7
21
  1.0.11
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytest_httpserver
3
- Version: 1.0.11
3
+ Version: 1.0.12
4
4
  Summary: pytest-httpserver is a httpserver for pytest
5
5
  Home-page: https://github.com/csernazs/pytest-httpserver
6
6
  License: MIT
@@ -68,7 +68,7 @@ author = "Zsolt Cserna"
68
68
  # built documents.
69
69
  #
70
70
  # The short X.Y version.
71
- version = "1.0.11"
71
+ version = "1.0.12"
72
72
  # The full version, including alpha/beta/rc tags.
73
73
  release = version
74
74
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pytest_httpserver"
3
- version = "1.0.11"
3
+ version = "1.0.12"
4
4
  description = "pytest-httpserver is a httpserver for pytest"
5
5
  authors = ["Zsolt Cserna <cserna.zsolt@gmail.com>"]
6
6
  license = "MIT"
@@ -35,39 +35,48 @@ def test_verify(httpserver: HTTPServer):
35
35
  def test_verify_assert_msg(httpserver: HTTPServer):
36
36
  httpserver.no_handler_status_code = 404
37
37
  httpserver.expect_request("/foo", json={"foo": "bar"}, method="POST").respond_with_data("OK")
38
- assert requests.get(httpserver.url_for("/foo"), headers={"User-Agent": "requests"}).status_code == 404
38
+ headers = {"User-Agent": "requests", "Accept-Encoding": "gzip, deflate"}
39
+ assert requests.get(httpserver.url_for("/foo"), headers=headers).status_code == 404
40
+
41
+ expected_lines = [
42
+ "Matching request found 0 times but expected 1 times.",
43
+ "Expected request: <RequestMatcher uri='/foo' method='POST' query_string=None headers={} data"
44
+ "=None json={'foo': 'bar'}>",
45
+ "Found 1 similar request(s):",
46
+ "--- Similar Request Start",
47
+ "Path: /foo",
48
+ "Method: GET",
49
+ "Body: b''",
50
+ f"Headers: Host: localhost:{httpserver.port}",
51
+ "User-Agent: requests",
52
+ "Accept-Encoding: gzip, deflate",
53
+ "Accept: */*",
54
+ "Connection: keep-alive",
55
+ "",
56
+ "",
57
+ "Query String: ''",
58
+ "--- Similar Request End",
59
+ ]
39
60
 
40
61
  with pytest.raises(AssertionError) as err:
41
62
  httpserver.assert_request_made(RequestMatcher("/foo", json={"foo": "bar"}, method="POST"))
42
63
 
43
- expected_message = f"""Matching request found 0 times but expected 1 times.
44
- Expected request: <RequestMatcher uri='/foo' method='POST' query_string=None headers={{}} data=None json={{'foo': 'bar'}}>
45
- Found 1 similar request(s):
46
- --- Similar Request Start
47
- Path: /foo
48
- Method: GET
49
- Body: b''
50
- Headers: Host: localhost:{httpserver.port}\r
51
- User-Agent: requests\r
52
- Accept-Encoding: gzip, deflate\r
53
- Accept: */*\r
54
- Connection: keep-alive\r
55
- \r
56
-
57
- Query String: ''
58
- --- Similar Request End
59
- """ # noqa: E501
60
- assert str(err.value) == expected_message
64
+ actual_lines = [x.strip() for x in str(err.value).splitlines()][: len(expected_lines)]
65
+ assert actual_lines == expected_lines
61
66
 
62
67
 
63
68
  def test_verify_assert_msg_no_similar_requests(httpserver: HTTPServer):
64
69
  httpserver.expect_request("/foo", json={"foo": "bar"}, method="POST").respond_with_data("OK")
65
70
 
71
+ expected_lines = [
72
+ "Matching request found 0 times but expected 1 times.",
73
+ "Expected request: <RequestMatcher uri='/foo' method='POST' query_string=None headers={} data"
74
+ "=None json={'foo': 'bar'}>",
75
+ "No similar requests found.",
76
+ ]
77
+
66
78
  with pytest.raises(AssertionError) as err:
67
79
  httpserver.assert_request_made(RequestMatcher("/foo", json={"foo": "bar"}, method="POST"))
68
80
 
69
- expected_message = """Matching request found 0 times but expected 1 times.
70
- Expected request: <RequestMatcher uri='/foo' method='POST' query_string=None headers={} data=None json={'foo': 'bar'}>
71
- No similar requests found.
72
- """
73
- assert str(err.value) == expected_message
81
+ actual_lines = [x.strip() for x in str(err.value).splitlines()][: len(expected_lines)]
82
+ assert actual_lines == expected_lines