summaryrefslogtreecommitdiffhomepage
path: root/test/test_variables.py (follow)
AgeCommit message (Collapse)AuthorFilesLines
2024-05-09tests: Change request_uri tests for changed behaviourGabor Javorszky1-4/+4
2024-04-10Tests: added $request_uri tests with proxyAndrei Zeliankou1-1/+100
This patch consist of 3 tests: 1. Ensure that $request_uri won't change while proxying the request. 2. Same as 1, but modifying the request using the "rewrite" directive. 3. Same as 2, but with rewrite containing a percent-encoded string.
2024-01-15Tests: pathlib used where appropriateAndrei Zeliankou1-10/+10
Also fixed various pylint errors and style issues.
2023-11-08Tests: 8XXX used as default port range.Andrei Zeliankou1-5/+5
After the launch of the project, the testing infrastructure was shared with nginx project in some cases. To avoid port overlap, a decision was made to shift the port range for Unit tests. This problem was resolved a long time ago and is no longer relevant, so it is now safe to use port 8XXX range as the default, as it is more appropriate for testing purposes.
2023-11-08Var: $request_id variable.Andrei Zeliankou1-0/+20
This variable contains a string that is formed using random data and can be used as a unique request identifier. This closes #714 issue on GitHub.
2023-07-11Tests: added tests for response header variables.Andrei Zeliankou1-0/+93
2023-06-14Tests: no caching for $uri variable.Andrei Zeliankou1-0/+23
2023-06-14Tests: get rid of classes in test files.Andrei Zeliankou1-336/+345
Class usage came from the unittest framework and it was always redundant after migration to the pytest. This commit removes classes from files containing tests to make them more readable and understandable.
2023-06-12Tests: prerequisites checking reworked.Andrei Zeliankou1-2/+0
Prerequisites check moved to the module level to simplify class structure. Discovery and prerequisites checks functions moved to the separate files. Introduced "require" fixture to provide per-test requirements check.
2023-05-29Tests: more fixtures.Andrei Zeliankou1-61/+62
Common methods from applications/proto.py converted to the fixtures. sysctl check moved to the specific file where it is using. Some options moved to the constructor to have early access.
2023-05-25Tests: assertion related fixes.Andrei Zeliankou1-7/+10
2023-05-25Tests: "temp_dir" fixture used were possible.Andrei Zeliankou1-2/+2
2023-05-25Tests: unified setup method usage.Andrei Zeliankou1-1/+3
To make fixtures accessible inside of setup methods in tests all these methods are renamed to the "setup_method_fixture" and decorated by autouse flag. Also all setup methods moved to the top of the files.
2023-02-21Tests: switched to using f-strings.Andrei Zeliankou1-11/+11
Previously, it was necessary to support older versions of Python for compatibility. F-strings were released in Python 3.6. Python 3.5 was marked as unsupported by the end of 2020, so now it's possible to start using f-strings safely for better readability and performance.
2022-11-20Var: improved variable parsing with empty names.Zhidao HONG1-0/+1
Unit parsed the case of "$uri$$host" into unknown variables. This commit makes it invalid variable instead.
2022-11-15Tests: fixed assertion in test_variables_dynamic.Andrei Zeliankou1-4/+7
2022-10-13Tests: added tests for the $request_time variable.Andrei Zeliankou1-0/+29
2022-10-11Tests: reworked "test_variables.py".Andrei Zeliankou1-194/+259
Access log used for the variables testing instead of limited routing. Added missed test for $status variable. Some tests moved from "test_access_log.py" to "test_variables.py".
2022-07-20Tests: added tests for translating $dollar into a literal $.Andrew Clayton1-0/+21
If you need to specify a $ in a URI you can now use '$dollar' or '${dollar}'. Added some tests for the above to test_variables.py setting a Location string.
2022-07-19Tests: added tests for more HTTP variables.Andrei Zeliankou1-0/+51
2022-07-14Tests: added tests for dynamic variables.Andrei Zeliankou1-0/+82
2022-06-01Tests: improved test for $request_uri variable.Andrei Zeliankou1-2/+2
2022-05-31Tests: Added tests for $request_uri.Alejandro Colomar1-0/+9
2022-01-31Tests: removed TestApplicationTLS.get_server_certificate().Andrei Zeliankou1-8/+4
distutils.version is replaced by packaging.version. Also minor style fixes.
2021-08-02Router: fixed segmentation fault.Zhidao HONG1-0/+19
In the case that routes or upstreams is empty and the pass option is a variable. If the resolved pass is routes or upstreams, a segment error occurred.
2021-04-05Tests: style.Andrei Zeliankou1-10/+2
2020-10-19Tests: fixed unit.log print.Andrei Zeliankou1-2/+0
2020-09-21Tests: added variable test with nonexistent upstream.Andrei Zeliankou1-0/+23
2020-09-16Tests: migrated to the pytest.Andrei Zeliankou1-49/+40
2020-08-31Tests: $host varaible test.Andrei Zeliankou1-7/+24
Also added few tests for $uri and minor style fixes.
2020-08-13Tests: added variables tests.Andrei Zeliankou1-0/+94