Exemple #1
0
 def test_mixed_construction(self):
     x = SetI32Lists({(0, 1, 2), (3, 4, 5)})
     z = SetSetI32Lists({x})
     pz = set(z)
     pz.add(x)
     nx = {(9, 10, 11)}
     pz.add(SetI32Lists(nx))
     cz = SetSetI32Lists(pz)
     self.assertIn(nx, cz)
     pz.add(5)
     with self.assertRaises(TypeError):
         SetSetI32Lists(pz)
Exemple #2
0
 def test_mixed_construction(self) -> None:
     x = SetI32Lists({(0, 1, 2), (3, 4, 5)})
     z = SetSetI32Lists({x})
     pz = set(z)
     pz.add(x)
     nx: AbstractSet[Sequence[int]] = {(9, 10, 11)}
     pz.add(SetI32Lists(nx))
     cz = SetSetI32Lists(pz)
     self.assertIn(nx, cz)
     pz.add(5)  # type: ignore
     with self.assertRaises(TypeError):
         SetSetI32Lists(pz)
Exemple #3
0
 def test_mixed_construction(self) -> None:
     x = SetI32Lists({(0, 1, 2), (3, 4, 5)})
     z = SetSetI32Lists({x})
     pz = set(z)
     pz.add(x)
     nx: AbstractSet[Sequence[int]] = {(9, 10, 11)}
     pz.add(SetI32Lists(nx))
     cz = SetSetI32Lists(pz)
     self.assertIn(nx, cz)
     # pyre-fixme[6]: Expected `AbstractSet[Sequence[int]]` for 1st param but got
     #  `int`.
     pz.add(5)
     with self.assertRaises(TypeError):
         SetSetI32Lists(pz)
Exemple #4
0
 def test_None(self) -> None:
     with self.assertRaises(TypeError):
         # pyre-fixme[6]: Expected `Optional[AbstractSet[Sequence[int]]]` for 1st
         #  param but got `Set[None]`.
         SetI32Lists({None})
     with self.assertRaises(TypeError):
         # pyre-fixme[6]: Expected
         #  `Optional[AbstractSet[AbstractSet[Sequence[int]]]]` for 1st param but
         #  got `Set[typing.Set[None]]`.
         SetSetI32Lists({{None}})
Exemple #5
0
 def test_None(self) -> None:
     with self.assertRaises(TypeError):
         SetI32Lists({None})  # type: ignore
     with self.assertRaises(TypeError):
         SetSetI32Lists({{None}})  # type: ignore
Exemple #6
0
 def test_hashability(self) -> None:
     hash(SetI32Lists())
     z = SetSetI32Lists({SetI32Lists({(1, 2, 3)})})
     hash(z)
     for sub_set in z:
         hash(sub_set)
Exemple #7
0
 def test_empty(self) -> None:
     SetI32Lists(set())
     SetI32Lists({()})
     SetSetI32Lists(set())
     SetSetI32Lists({SetI32Lists()})
     SetSetI32Lists({SetI32Lists({()})})
Exemple #8
0
 def test_is_container(self) -> None:
     self.assertIsInstance(SetI32Lists(), Container)
     self.assertIsInstance(SetSetI32Lists(), Container)
     self.assertIsInstance(SetI32(), Container)
Exemple #9
0
 def test_None(self):
     with self.assertRaises(TypeError):
         SetI32Lists({None})
     with self.assertRaises(TypeError):
         SetSetI32Lists({{None}})