Тесты, написанные для данного проекта
conftest
Actions before every run of all tests.
test_actions_before_all_tests()
Remove backup
and tmp
folders and everything inside them.
Then, create tmp
folder (it's needed for tests only).
Source code in tests/conftest.py
scenarios.py
run_and_wait(scheduler)
run_stop_and_restart(scheduler)
Run scheduler, stop it and restart scheduler from backup
Source code in tests/scenarios.py
schedule_jobs_sequentially(targets)
Do jobs one after another. This is one of basic scenarios for some tests.
Source code in tests/scenarios.py
test_fs
This file is for tests, required by the initial statement of work (SoW):
работа с файловой системой: создание, удаление, изменение директорий и файлов
работа с файлами: создание, чтение, запись
job_fs_create_folders(names)
Create folders
Source code in tests/test_fs.py
job_fs_delete_folders(names)
Delete a chain of folders one-by-one from the end to the beginning
Source code in tests/test_fs.py
job_fs_modify_folders(names, names_new)
Rename folders
Source code in tests/test_fs.py
names_of_principles()
Return few Zen of Python principles. They are used later in tests as an alternative to 'Lorem Ipsum'.
Source code in tests/test_fs.py
test_fs_directories(names_of_principles)
Create directories, modify their names and delete them.
Source code in tests/test_fs.py
test_fs_files(names_of_principles)
Create files, write text in them, modify text inside and, the last, read them.
Source code in tests/test_fs.py
test_web
This file is for tests, required by the initial statement of work (SoW):
работа с сетью: обработка ссылок (GET-запросы) и анализ полученного результата
job_request_weather(city)
This could be a fixture (a function which returns an inner function),
but in this case we get an error
"Can't pickle local object 'request_weather.
Source code in tests/test_web.py
test_web_job(cities_fixture)
Test few web jobs
Source code in tests/test_web.py
test_multi
The file is for tests, required by the initial statement of work (SoW):
описать конвейер выполнения основной задачи минимум из 3 задач, зависящих друг от друга и выполняющихся последовательно друг за другом
test_multi_job()
Test a conveyor (pipeline) of 3+ jobs.
Source code in tests/test_multi.py
test_multi
test_integration
This file is for just calculation tests. These tests don't require the internet and the file system.
test_calculations(fixture_for_power)
Test "three simple jobs for a scheduler"
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fixture_for_power |
fixture
|
a fixture with variables for a power function a**b |
required |
Source code in tests/test_calculations.py
test_calculations_with_a_stop(fixture_for_power)
Test "three jobs for a scheduler with stop and rerun"
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fixture_for_power |
fixture
|
a fixture with variables for a power function a**b |
required |