Update documentation

This commit is contained in:
2025-12-04 21:01:52 +03:00
parent 6be0a94ba9
commit baebeca55b
14 changed files with 747 additions and 508 deletions
+39 -34
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Argenta \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-12-02 22:27+0300\n"
"POT-Creation-Date: 2025-12-04 20:39+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en\n"
@@ -27,8 +27,8 @@ msgid ""
"В этом разделе описаны практики тестирования приложений на основе "
"``Argenta``. Примеры основаны на фактическом публичном API."
msgstr ""
"This section describes testing practices for applications based on ``Argenta``. "
"Examples are based on the actual public API."
"This section describes testing practices for applications based on "
"``Argenta``. Examples are based on the actual public API."
#: ../../root/testing.rst:7
msgid "Модульное тестирование обработчиков"
@@ -40,12 +40,12 @@ msgid ""
"чистые функции, не поднимая весь цикл приложения. Рекомендуются "
"``unittest`` или ``pytest``."
msgstr ""
"Handlers in ``Argenta`` are regular functions. They are convenient to test as pure "
"functions without starting the entire application cycle. ``unittest`` or ``pytest`` "
"are recommended."
"Handlers in ``Argenta`` are regular functions. They are convenient to "
"test as pure functions without starting the entire application cycle. "
"``unittest`` or ``pytest`` are recommended."
#: ../../root/testing.rst:11 ../../root/testing.rst:24
#: ../../root/testing.rst:37 ../../root/testing.rst:53
#: ../../root/testing.rst:37 ../../root/testing.rst:55
msgid "**Пример использования:**"
msgstr "**Usage example:**"
@@ -58,7 +58,8 @@ msgid ""
"Если обработчику нужны зависимости, используйте ``dishka`` и интеграцию "
"``Argenta``:"
msgstr ""
"If a handler needs dependencies, use ``dishka`` and ``Argenta`` integration:"
"If a handler needs dependencies, use ``dishka`` and ``Argenta`` "
"integration:"
#: ../../root/testing.rst:33
msgid "Интеграционное тестирование приложения"
@@ -71,9 +72,10 @@ msgid ""
"ввода. Это даёт близкое к реальности поведение без необходимости "
"симулировать ``stdin``."
msgstr ""
"For higher-level tests, assemble ``App`` and ``Router`` and call handlers through "
"command parsing, bypassing the infinite input loop. This provides behavior close to "
"reality without the need to simulate ``stdin``."
"For higher-level tests, assemble ``App`` and ``Router`` and call handlers"
" through command parsing, bypassing the infinite input loop. This "
"provides behavior close to reality without the need to simulate "
"``stdin``."
#: ../../root/testing.rst:46
msgid "E2E-тестирование цикла"
@@ -85,54 +87,57 @@ msgid ""
"передачей строк в ``stdin``. Это тяжелее и обычно не требуется. Если всё "
"же необходимо — пример ниже."
msgstr ""
"Full execution of the ``start_polling`` loop can be covered through a subprocess "
"with passing strings to ``stdin``. This is heavier and usually not required. If "
"still necessary, an example is below."
"Full execution of the ``start_polling`` loop can be covered through a "
"subprocess with passing strings to ``stdin``. This is heavier and usually"
" not required. If still necessary, an example is below."
#: ../../root/testing.rst:51
msgid ""
"Обязательно передавайте строковый триггер команды выхода последним "
"элементом в списке, который передаёте в контекстном менеджере при патче "
"``input`` как аргумент ``side_effects``, иначе тестируемое приложение "
"будет ожидать ввода следующей команды и не сможет корректно завершиться."
"**Важно:** Обязательно передавайте строковый триггер команды выхода "
"последним элементом в списке ``side_effects`` при патче ``input``."
msgstr ""
"Be sure to pass the exit command string trigger as the last element in the list "
"that you pass in the context manager when patching ``input`` as the ``side_effects`` "
"argument, otherwise the application under test will wait for the next command input "
"and will not be able to terminate correctly."
"**Important:** Always pass the exit command string trigger as the last "
"element in the ``side_effects`` list when patching ``input``."
#: ../../root/testing.rst:62
#: ../../root/testing.rst:53
msgid ""
"Иначе тестируемое приложение будет ожидать ввода следующей команды и не "
"сможет корректно завершиться."
msgstr ""
"Otherwise, the application under test will wait for the next command "
"input and will not be able to terminate correctly."
#: ../../root/testing.rst:64
msgid "Советы по тестированию"
msgstr "Testing Tips"
#: ../../root/testing.rst:64
#: ../../root/testing.rst:66
msgid "**Изолируйте тесты**: Каждый тест должен быть независимым от других."
msgstr "**Isolate tests**: Each test should be independent of others."
#: ../../root/testing.rst:65
#: ../../root/testing.rst:67
msgid ""
"**Моки для внешних интеграций**: БД, HTTP-клиенты и т.п. подменяйте "
"заглушками и провайдерами ``dishka``."
msgstr ""
"**Mocks for external integrations**: Replace databases, HTTP clients, etc. with "
"stubs and ``dishka`` providers."
"**Mocks for external integrations**: Replace databases, HTTP clients, "
"etc. with stubs and ``dishka`` providers."
#: ../../root/testing.rst:66
#: ../../root/testing.rst:68
msgid ""
"**Покрывайте ошибочные сценарии**: Некорректные флаги, неизвестные "
"команды, пустой ввод."
msgstr ""
"**Cover error scenarios**: Incorrect flags, unknown commands, empty input."
msgstr "**Cover error scenarios**: Incorrect flags, unknown commands, empty input."
#: ../../root/testing.rst:67
#: ../../root/testing.rst:69
msgid ""
"**Минимизируйте зависимость от форматирования**: Сравнивайте ключевые "
"фрагменты вывода, а не весь блок целиком."
msgstr ""
"**Minimize formatting dependency**: Compare key output fragments, not the entire "
"block."
"**Minimize formatting dependency**: Compare key output fragments, not the"
" entire block."
#: ../../root/testing.rst:68
#: ../../root/testing.rst:70
msgid "**Измеряйте покрытие**: Используйте ``pytest-cov``."
msgstr "**Measure coverage**: Use ``pytest-cov``."