How to use the typedload.typechecks function in typedload

To help you get started, we’ve selected a few typedload examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ltworf / typedload / tests / test_attrload.py View on Github external
def test_condition(self):
        assert typechecks.is_attrs(Person)
        assert typechecks.is_attrs(Students)
        assert typechecks.is_attrs(Mangle)
        assert typechecks.is_attrs(DetailedPerson)
        assert not typechecks.is_attrs(int)
        assert not typechecks.is_attrs(List[int])
        assert not typechecks.is_attrs(Union[str, int])
        assert not typechecks.is_attrs(Tuple[str, int])
github ltworf / typedload / tests / test_attrload.py View on Github external
def test_condition(self):
        assert typechecks.is_attrs(Person)
        assert typechecks.is_attrs(Students)
        assert typechecks.is_attrs(Mangle)
        assert typechecks.is_attrs(DetailedPerson)
        assert not typechecks.is_attrs(int)
        assert not typechecks.is_attrs(List[int])
        assert not typechecks.is_attrs(Union[str, int])
        assert not typechecks.is_attrs(Tuple[str, int])
github ltworf / typedload / tests / test_typechecks.py View on Github external
def test_is_literal(self):
        if sys.version_info.minor >= 8 :
            l = Literal[1, 2, 3]
            assert typechecks.is_literal(l)

        assert not typechecks.is_literal(3)
        assert not typechecks.is_literal(int)
        assert not typechecks.is_literal(str)
        assert not typechecks.is_literal(None)
        assert not typechecks.is_literal(List[int])
github ltworf / typedload / tests / test_typechecks.py View on Github external
def test_is_nonetype(self):
        assert typechecks.is_nonetype(type(None))
        assert not typechecks.is_nonetype(List[int])