Example #1
0
 def test_power_set(self):
     self.assertSetEqual(power_set({"A", "B", "C"}),
                         {frozenset({"A", "B", "C"}),
                          frozenset({"A", "B"}),
                          frozenset({"A", "C"}),
                          frozenset({"B", "C"}),
                          frozenset({"A"}),
                          frozenset({"B"}),
                          frozenset({"C"}),
                          frozenset()})
Example #2
0
 def test_set04(self):
     power_set(self.test_set04)
     self.assertEqual(power_set(self.test_set04).sort(),[[],[1],["h"],[{}],[1,"h"],[1,{}],["h",{}],[1,"h",{}]].sort())
Example #3
0
 def test_set02(self):
     self.assertEqual(power_set(self.test_set02).sort(),[[],[1],[2],[3],[1,2],[1,3],[2,3],[1,2,3]].sort())
Example #4
0
 def test_set03(self):
     self.assertEqual(power_set(self.test_set03).sort(),[[],["a"],["b"],["c"],["a","b"],["a","c"],["b","c"],["a","b","c"]].sort())
Example #5
0
 def test_set01(self):
     self.assertEqual(power_set(self.test_set01),[[]])