# Path: m2core/common/int_enum.py
# class M2CoreIntEnum(IntEnum):
#     @classmethod
#     def get(cls, member_value: int or str):
#         """
#         Returns enum member from `int` ID. If no member found - returns `None`
# 
#         :param member_value:
# 
#         :return: enum member or `None`
#         """
#         if type(member_value) is int:
#             try:
#                 return cls(member_value)
#             except ValueError:
#                 return None
#         elif type(member_value) is str:
#             for m in cls.all():
#                 if m.name == member_value:
#                     return m
#             return None
#         else:
#             raise AttributeError('You can load enum members only by `str` name or `int` value')
# 
#     @classmethod
#     def all(cls):
#         return [_ for _ in cls]


import unittest
from m2core.common.int_enum import M2CoreIntEnum
__author__ = 'Maxim Dutkin (max@dutkin.ru)'




class M2CoreIntEnumTest(unittest.TestCase):
    def setUp(self):

# Path: m2core/common/int_enum.py
# class M2CoreIntEnum(IntEnum):
#     @classmethod
#     def get(cls, member_value: int or str):
#         """
#         Returns enum member from `int` ID. If no member found - returns `None`
# 
#         :param member_value:
# 
#         :return: enum member or `None`
#         """
#         if type(member_value) is int:
#             try:
#                 return cls(member_value)
#             except ValueError:
#                 return None
#         elif type(member_value) is str:
#             for m in cls.all():
#                 if m.name == member_value:
#                     return m
#             return None
#         else:
#             raise AttributeError('You can load enum members only by `str` name or `int` value')
# 
#     @classmethod
#     def all(cls):
#         return [_ for _ in cls]


# Path: example/tests/core/m2core_int_enum_tests.py
import unittest
from m2core.common.int_enum import M2CoreIntEnum

__author__ = 'Maxim Dutkin (max@dutkin.ru)'




class M2CoreIntEnumTest(unittest.TestCase):
    def setUp(self):

        class SampleEnum(M2CoreIntEnum):