From d67d350142d4ef9a9cdbfc2bb4a6b2d8f261deb1 Mon Sep 17 00:00:00 2001 From: Gourav Date: Wed, 26 Jun 2024 12:07:09 +0530 Subject: tests: Add tests for python application factories Add the following tests cases: 1. When "factory" key is used inside the "targets" option. 2. When "factory" key is used at the root level of python application config. 3. When factory returns invalid callable or When factory is invalid callable Link: [ Commit subject & message formatting tweaks - Andrew ] Signed-off-by: Andrew Clayton --- test/python/factory/wsgi.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/python/factory/wsgi.py (limited to 'test/python') diff --git a/test/python/factory/wsgi.py b/test/python/factory/wsgi.py new file mode 100644 index 00000000..8ad4887b --- /dev/null +++ b/test/python/factory/wsgi.py @@ -0,0 +1,23 @@ +def wsgi_a(env, start_response): + start_response("200", [("Content-Length", "1")]) + return [b"1"] + + +def wsgi_b(env, start_response): + start_response("200", [("Content-Length", "1")]) + return [b"2"] + + +def wsgi_a_factory(): + return wsgi_a + + +def wsgi_b_factory(): + return wsgi_b + + +wsgi_invalid_callable = None + + +def wsgi_factory_returning_invalid_callable(): + return wsgi_invalid_callable -- cgit