mirror of https://github.com/tiangolo/fastapi.git
🎨 Auto format
This commit is contained in:
parent
bf8507209a
commit
e6a08f313d
|
|
@ -23,7 +23,9 @@ def test_gt(runner: CliRunner, root_dir: Path, copy_test_files):
|
|||
assert result.exit_code == 1, result.output
|
||||
|
||||
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text()
|
||||
expected_content = Path(f"{data_path}/translated_doc_lines_number_gt.md").read_text()
|
||||
expected_content = Path(
|
||||
f"{data_path}/translated_doc_lines_number_gt.md"
|
||||
).read_text()
|
||||
|
||||
assert fixed_content == expected_content # Translated doc remains unchanged
|
||||
assert "Error processing docs/lang/docs/doc.md" in result.output
|
||||
|
|
@ -45,7 +47,9 @@ def test_lt(runner: CliRunner, root_dir: Path, copy_test_files):
|
|||
# assert result.exit_code == 1, result.output
|
||||
|
||||
fixed_content = (root_dir / "docs" / "lang" / "docs" / "doc.md").read_text()
|
||||
expected_content = Path(f"{data_path}/translated_doc_lines_number_lt.md").read_text()
|
||||
expected_content = Path(
|
||||
f"{data_path}/translated_doc_lines_number_lt.md"
|
||||
).read_text()
|
||||
|
||||
assert fixed_content == expected_content # Translated doc remains unchanged
|
||||
assert "Error processing docs/lang/docs/doc.md" in result.output
|
||||
|
|
|
|||
|
|
@ -54,4 +54,3 @@ def test_lt(runner: CliRunner, root_dir: Path, copy_test_files):
|
|||
"Number of code include placeholders does not match the number of code includes "
|
||||
"in the original document (2 vs 3)"
|
||||
) in result.output
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# Test translation fixer tool { #test-translation-fixer }
|
||||
|
||||
|
||||
## Code blocks with and without comments { #code-blocks-with-and-without-comments }
|
||||
|
||||
This is a test page for the translation fixer tool.
|
||||
|
|
@ -65,7 +65,7 @@ title = "TOML Example" // Title of the document
|
|||
|
||||
The following code blocks use unsupported languages for comment preservation.
|
||||
Fixer tool will not preserve comments in these blocks.
|
||||
|
||||
|
||||
```javascript
|
||||
// This is a sample JavaScript code block
|
||||
console.log("Hello, world!"); // Print greeting
|
||||
|
|
@ -241,4 +241,4 @@ Tool should NOT add language code to their URLs.
|
|||
# Also not a header
|
||||
```
|
||||
|
||||
Some text
|
||||
Some text
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
# Тестовый инструмент исправления переводов { #test-translation-fixer }
|
||||
|
||||
|
||||
## Блоки кода с комментариями и без комментариев { #code-blocks-with-and-without-comments }
|
||||
|
||||
Это тестовая страница для инструмента исправления переводов.
|
||||
|
||||
### Блоки кода с комментариями { #code-blocks-with-comments }
|
||||
|
||||
Следующие блоки кода содержат комментарии в разных стилях.
|
||||
Следующие блоки кода содержат комментарии в разных стилях.
|
||||
Инструмент исправления должен исправлять содержимое, но корректно сохранять комментарии.
|
||||
|
||||
```python
|
||||
|
|
@ -40,7 +40,7 @@ $ python ./scripts/docs.py live es
|
|||
|
||||
### Блоки кода с комментариями, где язык использует другие стили комментариев { #code-blocks-with-different-comment-styles }
|
||||
|
||||
Следующие блоки кода содержат комментарии в разных стилях в зависимости от языка.
|
||||
Следующие блоки кода содержат комментарии в разных стилях в зависимости от языка.
|
||||
Инструмент исправления не будет сохранять комментарии в этих блоках.
|
||||
|
||||
```json
|
||||
|
|
@ -62,9 +62,9 @@ title = "TOML Example" // Заголовок документа
|
|||
|
||||
### Блоки кода с комментариями на неподдерживаемых языках или без указания языка { #code-blocks-with-unsupported-languages }
|
||||
|
||||
Следующие блоки кода используют неподдерживаемые языки для сохранения комментариев.
|
||||
Следующие блоки кода используют неподдерживаемые языки для сохранения комментариев.
|
||||
Инструмент исправления не будет сохранять комментарии в этих блоках.
|
||||
|
||||
|
||||
```javascript
|
||||
// Это пример блока кода на JavaScript
|
||||
console.log("Hello, world!"); // Печать приветствия
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
# Тестовый инструмент исправления переводов { #test-translation-fixer }
|
||||
|
||||
|
||||
## Блоки кода с комментариями и без комментариев { #code-blocks-with-and-without-comments }
|
||||
|
||||
Это тестовая страница для инструмента исправления переводов.
|
||||
|
||||
### Блоки кода с комментариями { #code-blocks-with-comments }
|
||||
|
||||
Следующие блоки кода содержат комментарии в разных стилях.
|
||||
Следующие блоки кода содержат комментарии в разных стилях.
|
||||
Инструмент исправления должен исправлять содержимое, но корректно сохранять комментарии.
|
||||
|
||||
```python
|
||||
|
|
@ -40,7 +40,7 @@ $ python ./scripts/docs.py live es
|
|||
|
||||
### Блоки кода с комментариями, где язык использует другие стили комментариев { #code-blocks-with-different-comment-styles }
|
||||
|
||||
Следующие блоки кода содержат комментарии в разных стилях в зависимости от языка.
|
||||
Следующие блоки кода содержат комментарии в разных стилях в зависимости от языка.
|
||||
Инструмент исправления не будет сохранять комментарии в этих блоках.
|
||||
|
||||
```json
|
||||
|
|
@ -62,9 +62,9 @@ title = "TOML Example" // Title of the document
|
|||
|
||||
### Блоки кода с комментариями на неподдерживаемых языках или без указания языка { #code-blocks-with-unsupported-languages }
|
||||
|
||||
Следующие блоки кода используют неподдерживаемые языки для сохранения комментариев.
|
||||
Следующие блоки кода используют неподдерживаемые языки для сохранения комментариев.
|
||||
Инструмент исправления не будет сохранять комментарии в этих блоках.
|
||||
|
||||
|
||||
```javascript
|
||||
// This is a sample JavaScript code block
|
||||
console.log("Hello, world!"); // Print greeting
|
||||
|
|
|
|||
|
|
@ -16,4 +16,4 @@ A bit more text
|
|||
|
||||
#Not a header
|
||||
|
||||
Final portion of text
|
||||
Final portion of text
|
||||
|
|
|
|||
|
|
@ -16,4 +16,4 @@ A bit more text
|
|||
|
||||
#Not a header
|
||||
|
||||
Final portion of text
|
||||
Final portion of text
|
||||
|
|
|
|||
|
|
@ -16,4 +16,4 @@ A bit more text
|
|||
|
||||
#Not a header
|
||||
|
||||
Final portion of text
|
||||
Final portion of text
|
||||
|
|
|
|||
|
|
@ -16,4 +16,4 @@ A bit more text
|
|||
|
||||
# Extra header
|
||||
|
||||
Final portion of text
|
||||
Final portion of text
|
||||
|
|
|
|||
|
|
@ -16,4 +16,4 @@ A bit more text
|
|||
|
||||
#Not a header
|
||||
|
||||
Final portion of text
|
||||
Final portion of text
|
||||
|
|
|
|||
|
|
@ -5,9 +5,7 @@ from typer.testing import CliRunner
|
|||
|
||||
from scripts.translation_fixer import cli
|
||||
|
||||
data_path = Path(
|
||||
"scripts/tests/test_translation_fixer/test_html_links/data"
|
||||
).absolute()
|
||||
data_path = Path("scripts/tests/test_translation_fixer/test_html_links/data").absolute()
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
|||
Loading…
Reference in New Issue