Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/render_engine_cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def load_config(self, config_file: str = CONFIG_FILE_NAME):
try:
with open(config_file) as stored_config_file:
try:
stored_config = toml.load(stored_config_file).get("render-engine", {}).get("cli", {})
stored_config = toml.load(stored_config_file).get("tool.render-engine", {}).get("cli", {})
except TomlDecodeError as exc:
click.echo(f"Encountered an error while parsing {config_file} - {exc}.")
else:
Expand Down
14 changes: 11 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ def test_collection_call_with_content():
[
(["key1=value1", "key2=value2"], {"key1": "value1", "key2": "value2"}),
(["key1:value1", "key2:value2"], {"key1": "value1", "key2": "value2"}),
(["author=John Doe", "tags:python,testing"], {"author": "John Doe", "tags": "python,testing"}),
(
["author=John Doe", "tags:python,testing"],
{"author": "John Doe", "tags": "python,testing"},
),
([], {}),
(None, {}),
],
Expand All @@ -103,7 +106,9 @@ def test_split_args_error_handling():

def test_config_loading_with_valid_config(tmp_path, monkeypatch):
"""Tests config loading from pyproject.toml (2025.5.1b1 feature)"""
config_content = {"render-engine": {"cli": {"module": "myapp", "site": "MySite", "collection": "MyCollection"}}}
config_content = {
"tool.render-engine": {"cli": {"module": "myapp", "site": "MySite", "collection": "MyCollection"}}
}

config_file = tmp_path / "pyproject.toml"
config_file.write_text(toml.dumps(config_content))
Expand Down Expand Up @@ -145,7 +150,10 @@ def test_collection_entry_with_custom_attributes():
"""Tests that custom attributes are passed through to collection entry"""
test_collection = Collection()
content = create_collection_entry(
content="Test content", collection=test_collection, author="Test Author", tags="test,example"
content="Test content",
collection=test_collection,
author="Test Author",
tags="test,example",
)
post = frontmatter.loads(content)

Expand Down
Loading