Skip to content

Commit b2bff5d

Browse files
committed
Add test for states repr [skip ci]
1 parent 7969328 commit b2bff5d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/mock_vws/_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class States(Enum):
1717

1818
def __repr__(self) -> str:
1919
"""
20-
The representation should not include the generated number.
20+
Return a representation which does not include the generated number.
2121
"""
2222
return '<{class_name}.{state_name}>'.format(
2323
class_name=self.__class__.__name__,

tests/mock_vws/test_usage.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from requests import codes
1818
from requests_mock.exceptions import NoMockAddress
1919

20-
from mock_vws import MockVWS
20+
from mock_vws import MockVWS, States
2121
from mock_vws._constants import TargetStatuses
2222
from tests.mock_vws.utils import (
2323
VuforiaDatabaseKeys,
@@ -541,3 +541,15 @@ def test_custom(
541541

542542
expected = query_recognizes_deletion
543543
assert abs(expected - recognize_deletion_seconds) < 0.2
544+
545+
546+
class TestStates:
547+
"""
548+
Tests for different mock states.
549+
"""
550+
551+
def test_repr(self) -> None:
552+
"""
553+
Test for the representation of a ``State``.
554+
"""
555+
assert repr(States.WORKING) == '<States.WORKING>'

0 commit comments

Comments
 (0)