iter states in states group

This commit is contained in:
Andrey Tikhonov 2021-08-17 23:37:15 +03:00
parent 9451a085d1
commit 31ab2cab5e
2 changed files with 10 additions and 0 deletions

View file

@ -150,3 +150,10 @@ class TestStatesGroup:
assert 42 not in MyGroup
assert MyGroup.MyNestedGroup.get_root() is MyGroup
def test_iterable(self):
class Group(StatesGroup):
x = State()
y = State()
assert set(Group) == {Group.x, Group.y}