File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 11pytest
22pytest-cov
3- essentials-openapi [full ]>= 1.0.2
3+ essentials-openapi [full ]>= 1.2.1
44mkdocs
55flake8
66black
Original file line number Diff line number Diff line change 11import textwrap
2+ from unittest .mock import Mock
23
34import pytest
45
78from . import get_resource_file_path
89
910
11+ def make_mock_page (src_dir = "docs" , src_path = "index.md" ):
12+ mock_file = Mock ()
13+ mock_file .src_dir = src_dir
14+ mock_file .src_path = src_path
15+ mock_page = Mock ()
16+ mock_page .file = mock_file
17+ return mock_page
18+
19+
1020def test_markdown_without_oad ():
1121 handler = MkDocsOpenAPIDocumentationPlugin ()
1222
@@ -20,7 +30,7 @@ def test_markdown_without_oad():
2030 )
2131 )
2232
23- result = handler .on_page_markdown (example )
33+ result = handler .on_page_markdown (example , make_mock_page () )
2434 assert result == example
2535
2636
@@ -39,7 +49,7 @@ def test_markdown_with_oad(file_name):
3949 )
4050 )
4151
42- result = handler .on_page_markdown (example )
52+ result = handler .on_page_markdown (example , make_mock_page () )
4353
4454 # Note: not testing the full output since this responsibility belongs to the
4555 # essentials-openapi package
You can’t perform that action at this time.
0 commit comments