Skip to content

Commit fdbc32a

Browse files
committed
tests: add checks for _non_default_entries
1 parent 2eaf51e commit fdbc32a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

quartodoc/tests/test_builder_blueprint.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from quartodoc import get_object
22
from quartodoc import layout as lo
33
from quartodoc.builder.blueprint import (
4+
_non_default_entries,
45
BlueprintTransformer,
56
blueprint,
67
WorkaroundKeyError,
@@ -37,6 +38,23 @@ def bp():
3738
return BlueprintTransformer()
3839

3940

41+
def test_non_default_entries_auto():
42+
assert _non_default_entries(lo.Auto(name="a_func", include_attributes=False)) == {
43+
"name": "a_func",
44+
"include_attributes": False,
45+
}
46+
47+
48+
def test_non_default_entries_auto_member_options():
49+
# these entries are nested inside auto
50+
res = _non_default_entries(
51+
lo.Auto(name="a_func", member_options={"include_attributes": False})
52+
)
53+
54+
assert res["name"] == "a_func"
55+
assert _non_default_entries(res["member_options"]) == {"include_attributes": False}
56+
57+
4058
@pytest.mark.parametrize("path", ["quartodoc.get_object", "quartodoc:get_object"])
4159
def test_blueprint_basic(bp, path):
4260
auto = lo.Auto(name=path)

0 commit comments

Comments
 (0)