lorien / test_server Goto Github PK
View Code? Open in Web Editor NEWServer to test HTTP clients
License: MIT License
Server to test HTTP clients
License: MIT License
Just normal build, install and test cycle used on building package from non-root account:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-test-server-0.0.31-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-test-server-0.0.31-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/tkloczko/rpmbuild/BUILD/test_server-0.0.31, configfile: pytest.ini, testpaths: test/
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, cases-3.6.3, Faker-8.10.0
collected 30 items / 1 deselected / 29 selected
test/callbacks.py .. [ 6%]
test/server.py ........................... [100%]
============================================================================= warnings summary =============================================================================
test_server/server.py:9
/home/tkloczko/rpmbuild/BUILD/test_server-0.0.31/test_server/server.py:9: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import defaultdict, Iterable
test/callbacks.py: 1 warning
test/server.py: 32 warnings
/usr/lib/python3.8/site-packages/waitress/adjustments.py:441: DeprecationWarning: In future versions of Waitress clear_untrusted_proxy_headers will be set to True by default. You may opt-out by setting this value to False, or opt-in explicitly by setting this to True.
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/warnings.html
============================================================== 29 passed, 1 deselected, 34 warnings in 29.37s ==============================================================
Fedora 39 will ship with Python 3.12, a test build shows error in test_null_bytes and some DeprecationWarnings.
============================= test session starts ==============================
platform linux -- Python 3.12.0b4, pytest-7.3.2, pluggy-1.0.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /builddir/build/BUILD/test_server-0.0.31
configfile: pytest.ini
testpaths: test/
collecting ... collected 30 items / 1 deselected / 29 selected
test/callbacks.py::test_callback PASSED [ 3%]
test/callbacks.py::test_callback_yield_ PASSED [ 6%]
test/server.py::test_get PASSED [ 10%]
test/server.py::test_non_utf_request_data PASSED [ 13%]
test/server.py::test_request_client_ip PASSED [ 17%]
test/server.py::test_path PASSED [ 20%]
test/server.py::test_post PASSED [ 24%]
test/server.py::test_response_once_get PASSED [ 27%]
test/server.py::test_response_once_headers PASSED [ 31%]
test/server.py::test_request_headers PASSED [ 34%]
test/server.py::test_response_once_reset_headers PASSED [ 37%]
test/server.py::test_method_sleep PASSED [ 41%]
test/server.py::test_response_once_code PASSED [ 44%]
test/server.py::test_request_done_after_start PASSED [ 48%]
test/server.py::test_request_done PASSED [ 51%]
test/server.py::test_wait_request PASSED [ 55%]
test/server.py::test_wait_timeout_error PASSED [ 58%]
test/server.py::test_request_cookies PASSED [ 62%]
test/server.py::test_response_once_cookies PASSED [ 65%]
test/server.py::test_default_header_content_type PASSED [ 68%]
test/server.py::test_custom_header_content_type PASSED [ 72%]
test/server.py::test_default_header_server PASSED [ 75%]
test/server.py::test_custom_header_server PASSED [ 79%]
test/server.py::test_options_method PASSED [ 82%]
test/server.py::test_multiple_start_stop_cycles PASSED [ 86%]
test/server.py::test_data_generator PASSED [ 89%]
test/server.py::test_specific_port PASSED [ 93%]
test/server.py::test_null_bytes FAILED [ 96%]
test/server.py::test_utf_header PASSED [100%]
=================================== FAILURES ===================================
_______________________________ test_null_bytes ________________________________
test/server.py:278: in test_null_bytes
assert unquote(server.request['path']) == '/\x00/'`
E AssertionError: assert '/' == '/\x00/'
E - /�/
E + /
=============================== warnings summary ===============================
../../../../usr/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:178
/usr/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:178: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
exec(co, module.__dict__)
test/callbacks.py: 1 warning
test/server.py: 32 warnings
/usr/lib/python3.12/site-packages/waitress/adjustments.py:449: DeprecationWarning: In future versions of Waitress clear_untrusted_proxy_headers will be set to True by default. You may opt-out by setting this value to False, or opt-in explicitly by setting this to True.
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
The release tarball has only the following files from test
directory:
test-server-0.0.31/test/
test-server-0.0.31/test/server.py
test-server-0.0.31/test/__init__.py
This is apparently insufficient to run the test suite.
+ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx
running build_sphinx
Running Sphinx v4.0.3
making output directory... done
WARNING: html_static_path entry '_static' does not exist
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 6 added, 0 changed, 0 removed
reading sources... [100%] index
/home/tkloczko/rpmbuild/BUILD/test_server-0.0.31/docs/api_response.rst:37: WARNING: Title underline too short.
response :: path
^^^^^^^^^^^^^^^
/home/tkloczko/rpmbuild/BUILD/test_server-0.0.31/docs/api_response.rst:37: WARNING: Title underline too short.
response :: path
^^^^^^^^^^^^^^^
WARNING: autodoc: failed to import module 'util' from module 'test_server'; the following exception was raised:
No module named 'test_server.util'
/home/tkloczko/rpmbuild/BUILD/test_server-0.0.31/docs/index.rst:4: WARNING: duplicate object description of test_server.server, other instance in api_server, use :noindex: for one of them
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-test_server.3 { api_server api_util api_error api_request api_response } done
build succeeded, 5 warnings.
GET /\x00/
py2: /\x00/
py3: /%00/
https://bugzilla.redhat.com/show_bug.cgi?id=1793021
test_server/test_server/server.py
Line 9 in e46b5f4
Thanks for the library!
The recently introduced dependency on multipart
made it impossible to package the new version on Gentoo Linux since we already package python-multipart
which uses the same package name (sic!) and is required by the more popular starlette package.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.