Skip to content

Commit ff73e0b

Browse files
committed
Test that pyproject.toml handles all repository types
Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
1 parent a897051 commit ff73e0b

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

tests/test_pyproject.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# License: MIT
2+
# Copyright © 2023 Frequenz Energy-as-a-Service GmbH
3+
4+
"""Tests for the pyproject.toml file."""
5+
6+
import tomllib
7+
8+
from frequenz.repo.config import RepositoryType
9+
10+
from . import utils
11+
12+
13+
def test_optional_dependencies() -> None:
14+
"""Test that all repository types handled match the defined in RepositoryType."""
15+
expected = {t.value for t in RepositoryType}
16+
17+
with open("pyproject.toml", "rb") as pyproject_file:
18+
pyproject_toml = tomllib.load(pyproject_file)
19+
defined = {
20+
k
21+
for k in pyproject_toml["project"]["optional-dependencies"].keys()
22+
if k != "dev" and not k.startswith("dev-")
23+
}
24+
assert defined == expected, utils.MSG_UNEXPECTED_REPO_TYPES

0 commit comments

Comments
 (0)