예제 #1
0
파일: testtypes.py 프로젝트: zanellia/mypy
 def test_false_only_of_instance(self) -> None:
     fo = false_only(self.fx.a)
     assert_equal(str(fo), "A")
     assert_false(fo.can_be_true)
     assert_true(fo.can_be_false)
     assert_type(Instance, fo)
     # The original class still can be true
     assert_true(self.fx.a.can_be_true)
예제 #2
0
파일: testtypes.py 프로젝트: zanellia/mypy
 def test_true_only_of_instance(self) -> None:
     to = true_only(self.fx.a)
     assert_equal(str(to), "A")
     assert_true(to.can_be_true)
     assert_false(to.can_be_false)
     assert_type(Instance, to)
     # The original class still can be false
     assert_true(self.fx.a.can_be_false)
예제 #3
0
 def test_false_only_of_instance(self):
     fo = false_only(self.fx.a)
     assert_equal(str(fo), "A")
     assert_false(fo.can_be_true)
     assert_true(fo.can_be_false)
     assert_type(Instance, fo)
     # The original class still can be true
     assert_true(self.fx.a.can_be_true)
예제 #4
0
 def test_true_only_of_instance(self):
     to = true_only(self.fx.a)
     assert_equal(str(to), "A")
     assert_true(to.can_be_true)
     assert_false(to.can_be_false)
     assert_type(Instance, to)
     # The original class still can be false
     assert_true(self.fx.a.can_be_false)
예제 #5
0
파일: testtypes.py 프로젝트: zanellia/mypy
 def test_false_only_of_true_type_is_uninhabited(self) -> None:
     fo = false_only(self.tuple(AnyType(TypeOfAny.special_form)))
     assert_type(UninhabitedType, fo)
예제 #6
0
파일: testtypes.py 프로젝트: zanellia/mypy
 def test_true_only_of_false_type_is_uninhabited(self) -> None:
     to = true_only(NoneTyp())
     assert_type(UninhabitedType, to)
예제 #7
0
 def test_false_only_of_true_type_is_uninhabited(self):
     fo = false_only(self.tuple(AnyType()))
     assert_type(UninhabitedType, fo)
예제 #8
0
 def test_true_only_of_false_type_is_uninhabited(self):
     to = true_only(NoneTyp())
     assert_type(UninhabitedType, to)