Add new utilities for hosting service unit tests.
Review Request #9857 — Created April 4, 2018 and submitted
These new utilities make it easier to test HTTP requests and responses
dealing with multiple paths, and simple responses payloads or errors
with custom headers. It does this through amake_handler_for_paths()
function that takes in a dictionary of information and returns a method
to pass tosetup_http_test()
.It also adds a
dump_json()
method that wrapsjson.dumps()
and
returns a bytestring, helping deal with Python 2/3 compatibility.
Used these new methods in upcoming unit tests, which pass.
- Change Summary:
-
Removed an extra space.
- Commit:
-
1fc8abee441f656388426ead4fc5f7fcb0c3b584192de67e9c80a52fe99d30fc57fc5230f11c3140
- Diff:
-
Revision 2 (+105 -12)
Checks run (2 succeeded)
flake8
passed.
JSHint
passed.
- Change Summary:
-
Changed "a" to "an" in a docstring.
- Commit:
-
192de67e9c80a52fe99d30fc57fc5230f11c314044cba2896dab48d1eb42ffd936adbad9ac2d4bab
- Diff:
-
Revision 3 (+105 -12)
Checks run (2 succeeded)
flake8
passed.
JSHint
passed.