Skip to content

Commit

Permalink
DX: add supertable test
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Aug 12, 2024
1 parent 5103b1f commit 29a60b2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/utilities/pyproject/test_setters.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,23 @@ def test_create_sub_table(table_key: str):
lint = ["ruff"]
""")
assert new_content.strip() == expected.strip()


def test_create_sub_table_with_super_table():
pyproject = load_pyproject_toml("", modifiable=True)
pixi = create_sub_table(pyproject, "tool.pixi")
pixi["channels"] = ["conda-forge"]
pixi["platforms"] = ["linux-64"]
task_table = create_sub_table(pyproject, "tool.pixi.feature.dev.tasks.test")
task_table["cmd"] = "pytest"

new_content = tomlkit.dumps(pyproject)
expected = dedent("""
[tool.pixi]
channels = ["conda-forge"]
platforms = ["linux-64"]
[tool.pixi.feature.dev.tasks.test]
cmd = "pytest"
""")
assert new_content.strip() == expected.strip()

0 comments on commit 29a60b2

Please sign in to comment.