Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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])
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])
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])
def test_is_nonetype(self):
assert typechecks.is_nonetype(type(None))
assert not typechecks.is_nonetype(List[int])