コード例 #1
0
ファイル: testtypes.py プロジェクト: rondan100/tkinter
 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 プロジェクト: python/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)
コード例 #3
0
ファイル: testtypes.py プロジェクト: python/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)
コード例 #4
0
ファイル: testtypes.py プロジェクト: rondan100/tkinter
 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)
コード例 #5
0
ファイル: testtypes.py プロジェクト: python/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 プロジェクト: python/mypy
 def test_true_only_of_false_type_is_uninhabited(self) -> None:
     to = true_only(NoneType())
     assert_type(UninhabitedType, to)
コード例 #7
0
ファイル: testtypes.py プロジェクト: rondan100/tkinter
 def test_false_only_of_true_type_is_uninhabited(self) -> None:
     with strict_optional_set(True):
         fo = false_only(self.tuple(AnyType(TypeOfAny.special_form)))
         assert_type(UninhabitedType, fo)
コード例 #8
0
ファイル: testtypes.py プロジェクト: rondan100/tkinter
 def test_true_only_of_false_type_is_uninhabited(self) -> None:
     to = true_only(NoneType())
     assert_type(UninhabitedType, to)
コード例 #9
0
 def test_false_only_of_true_type_is_uninhabited(self) -> None:
     fo = false_only(self.tuple(AnyType(TypeOfAny.special_form)))
     assert_type(UninhabitedType, fo)