Skip to content

Commit a57efbd

Browse files
committed
Add test for gardenlinux.features.CName
Signed-off-by: Tobias Wolf <[email protected]>
1 parent 2d80a74 commit a57efbd

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tests/features/test_cname.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import pytest
2+
3+
from gardenlinux.features import CName
4+
5+
6+
@pytest.mark.parametrize(
7+
"input_cname, expected_output",
8+
[
9+
(
10+
"aws-gardener_prod",
11+
"aws-gardener_prod",
12+
),
13+
(
14+
"metal-khost_dev",
15+
"metal-khost_dev",
16+
),
17+
(
18+
"metal_pxe",
19+
"metal_pxe",
20+
),
21+
],
22+
)
23+
def test_cname_flavor(input_cname: str, expected_output: dict):
24+
"""
25+
Tests if cname returns the dict with expected features.
26+
27+
If you discover that this test failed, you may want to verify if the included
28+
features have changed since writing this test. In this case, update the expected output accordingly.
29+
You can print the output of cname so you have the dict in the expected format.
30+
"""
31+
cname = CName(input_cname)
32+
assert cname.flavor == expected_output

0 commit comments

Comments
 (0)