Skip to content

Commit be9c829

Browse files
committed
Make sure calls to from_proto() for enums are deprecated
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 4612de7 commit be9c829

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/test_client_common.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
"""Tests for the frequenz.client.common package."""
55

6+
import pytest
7+
68
from frequenz.client.common.microgrid.components import (
79
ComponentCategory,
810
ComponentErrorCode,
@@ -13,16 +15,19 @@
1315
def test_components() -> None:
1416
"""Test the components."""
1517
for category in ComponentCategory:
16-
assert ComponentCategory.from_proto(category.to_proto()) == category
18+
with pytest.deprecated_call():
19+
assert ComponentCategory.from_proto(category.to_proto()) == category
1720

1821

1922
def test_component_state_code() -> None:
2023
"""Test the component state code."""
2124
for state_code in ComponentStateCode:
22-
assert ComponentStateCode.from_proto(state_code.to_proto()) == state_code
25+
with pytest.deprecated_call():
26+
assert ComponentStateCode.from_proto(state_code.to_proto()) == state_code
2327

2428

2529
def test_component_error_code() -> None:
2630
"""Test the component error code."""
2731
for error_code in ComponentErrorCode:
28-
assert ComponentErrorCode.from_proto(error_code.to_proto()) == error_code
32+
with pytest.deprecated_call():
33+
assert ComponentErrorCode.from_proto(error_code.to_proto()) == error_code

0 commit comments

Comments
 (0)