This repository has been archived on 2025-07-31. You can view files and clone it, but cannot push or open issues or pull requests.
Files
fbchat/tests/test_core.py
2019-10-27 14:40:08 +01:00

15 lines
423 B
Python

import pytest
from fbchat._core import Enum
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
def test_enum_extend_if_invalid():
class TestEnum(Enum):
A = 1
B = 2
assert TestEnum._extend_if_invalid(1) == TestEnum.A
assert TestEnum._extend_if_invalid(3) == TestEnum.UNKNOWN_3
assert TestEnum._extend_if_invalid(3) == TestEnum.UNKNOWN_3
assert TestEnum(3) == TestEnum.UNKNOWN_3