Skip to content

Commit

Permalink
invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
radoering committed Jul 13, 2024
1 parent 7e92620 commit b3cc177
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/json/fixtures/self_invalid_plugin.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[tool.poetry]
name = "foobar"
version = "0.1.0"
description = ""
authors = ["Your Name <[email protected]>"]

[tool.poetry.self.plugins]
foo = 5
12 changes: 12 additions & 0 deletions tests/json/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ def test_self_valid() -> None:
assert Factory.validate(content) == {"errors": [], "warnings": []}


def test_self_invalid_plugin() -> None:
toml: dict[str, Any] = TOMLFile(FIXTURE_DIR / "self_invalid_plugin.toml").read()
content = toml["tool"]["poetry"]
assert Factory.validate(content) == {
"errors": [
"data.self.plugins.foo must be valid exactly by one definition"
" (0 matches found)"
],
"warnings": [],
}


def test_dependencies_is_consistent_to_poetry_core_schema() -> None:
with (SCHEMA_DIR / "poetry.json").open(encoding="utf-8") as f:
schema = json.load(f)
Expand Down

0 comments on commit b3cc177

Please sign in to comment.