-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
95 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,24 @@ | ||
from itertools import product | ||
|
||
import pytest | ||
|
||
from mkapi.core.base import Base, Inline | ||
from mkapi.core.inherit import is_complete | ||
from mkapi.core.inherit import get_section, is_complete | ||
from mkapi.core.node import Node | ||
|
||
|
||
def test_is_complete(): | ||
assert is_complete(Node(Base)) | ||
assert not is_complete(Node(Inline)) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"name, mode", product(["Parameters", "Attributes"], ["Docstring", "Signature"]) | ||
) | ||
def test_get_section(name, mode): | ||
def func(): | ||
pass | ||
|
||
section = get_section(Node(func), name, mode) | ||
section.name == name | ||
assert not section |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from mkapi.core.code import get_code | ||
from mkapi.core.module import get_module | ||
from mkapi.core.renderer import renderer | ||
|
||
|
||
def test_module_empty_filters(): | ||
module = get_module("mkapi.core.base") | ||
m = renderer.render_module(module).split("\n") | ||
assert m[0] == "# ![mkapi](mkapi.core.base|plain|link|sourcelink)" | ||
assert m[2] == "## ![mkapi](mkapi.core.base.Base||link|sourcelink)" | ||
assert m[3] == "## ![mkapi](mkapi.core.base.Inline||link|sourcelink)" | ||
assert m[4] == "## ![mkapi](mkapi.core.base.Type||link|sourcelink)" | ||
assert m[5] == "## ![mkapi](mkapi.core.base.Item||link|sourcelink)" | ||
|
||
|
||
def test_code_empty_filters(): | ||
code = get_code("mkapi.core.base") | ||
m = renderer.render_code(code) | ||
assert '<span class="mkapi-object-prefix">mkapi.core.</span>' in m | ||
assert '<span class="mkapi-object-name">base</span>' in m | ||
assert '<span id="mkapi.core.base"></span>' in m | ||
assert '<a class="mkapi-docs-link" href="../../mkapi.core.base">DOCS</a>' in m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.