python-tuf/tests
Lukas Puehringer 3ed21abf2d test: stop using unittest_toolbox in new tests
Update new test modules to stop using unittest_toolbox, in
preparation for its removal in #1790.

The tools provided by unittest_toolbox can easily (in a more
obvious way) be replaced by using the standard library modules
`tempfile` and `random` (no more used) directly.

In the case of tempdir and -file creation/removal, skipping the use
of unittest_toolbox, which does this by default, also uncovers some
test cleanup failures, which would occur when temporary test
directories were removed while a test server hadn't released them.
(see `except OSError: pass` in unittest_toolbox's `tearDown`
method)

**Change details**

**test_fetcher_ng.py:**
- Stop implicitly creating (setUp) and removing (tearDown) tmp test
dirs.  -Move now manual creation of an exemplary targets file to
setUpClass, as the same file is used by all tests. And remove it
explicitly in tearDownClass after killing the server (see note
about failure above).  - Trigger URL parsing error with a hardcoded
invalid URL string instead of a random string.

**test_updater_ng.py**
- Stop implicitly creating (setUp) and removing (tearDown) tmp test
dirs.
- Explicitly create tmp test dirs in setUp, but don't remove
them in tearDown to avoid above mentioned failures. They will be
removed all at once when removing the tmp root test dir in
tearDownClass

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-01-24 13:54:13 +01:00
..
repository_data Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
ssl_certs Test: add https test with expired server certificate 2018-09-26 14:15:36 -04:00
.coveragerc Move omit to run section in .coveragerc 2019-07-11 14:32:49 +02:00
__init__.py Support ISO 8601, vendor iso8601, clean codebase. 2014-04-19 14:27:53 -04:00
aggregate_tests.py Apply black on tests/aggregate_tests.py 2021-12-07 11:51:23 +02:00
fast_server_exit_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
repository_simulator.py Merge pull request #1783 from MVrachev/drop-python3.6 2022-01-20 14:46:52 +01:00
simple_https_server_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
simple_server.py Apply linters on tests/simple_server.py 2021-12-07 11:51:23 +02:00
slow_retrieval_server_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_api.py Replace UnsupportedAlgorithmError with ValueError 2022-01-19 16:52:19 +02:00
test_arbitrary_package_attack_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_developer_tool_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_download_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_endless_data_attack_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_examples.py test: add missing return type hint in test method 2021-12-10 10:48:36 +01:00
test_extraneous_dependencies_attack_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_fetcher_ng.py test: stop using unittest_toolbox in new tests 2022-01-24 13:54:13 +01:00
test_fetcher_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_formats_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_indefinite_freeze_attack_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_key_revocation_integration_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_keydb_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_log_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_metadata_serialization.py Metadata API: Make Role.keyids ordered 2022-01-05 14:28:17 +02:00
test_mirrors_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_mix_and_match_attack_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_multiple_repositories_integration_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_replay_attack_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_repository_lib_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_repository_tool_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_roledb_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_root_versioning_integration_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_sig_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_slow_retrieval_attack_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_trusted_metadata_set.py test: define TESTS_DIR constant 2022-01-24 13:54:07 +01:00
test_tutorial_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_unittest_toolbox_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_updater_consistent_snapshot.py Fix linter errors in tests 2021-12-15 12:14:20 +02:00
test_updater_delegation_graphs.py Add tuf/api/exceptions.py 2022-01-19 16:52:19 +02:00
test_updater_fetch_target.py Add tuf/api/exceptions.py 2022-01-19 16:52:19 +02:00
test_updater_key_rotations.py Add tuf/api/exceptions.py 2022-01-19 16:52:19 +02:00
test_updater_ng.py test: stop using unittest_toolbox in new tests 2022-01-24 13:54:13 +01:00
test_updater_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_updater_root_rotation_integration_old.py Rename old test files by adding old suffix 2021-12-09 16:44:25 +02:00
test_updater_top_level_update.py Make LengthOrHashMismatchError a RepositoryError 2022-01-19 16:52:19 +02:00
test_utils.py test: stop using unittest_toolbox in new tests 2022-01-24 13:54:13 +01:00
utils.py test: define TESTS_DIR constant 2022-01-24 13:54:07 +01:00