Beispiel #1
0
 def test_issubset_invalid_input(self):
     with self.assertRaises(TypeError):
         is_subset(['q', 'qe', 1, 2, 3], [1, 23, 3, 4, 54])
Beispiel #2
0
 def test_issubset_rhs_empty(self):
     self.assertTrue(is_subset([1, 3, 3, 4, 3, 2, 3, 3, 4], []))
Beispiel #3
0
 def test_issubset_lhs_empty(self):
     self.assertFalse(is_subset([], [1, 32, 4, 3, 2]))
Beispiel #4
0
 def test_issubset_empty_sets(self):
     self.assertTrue(is_subset([], []))
Beispiel #5
0
 def test_issubset_false_repeated(self):
     self.assertFalse(
         is_subset([1, 2, 3, 4, 2, 23, 4, 23, 2, 2, 1, 2, 3],
                   [1, 2, 3, 4, 4, 34, 4, 5]))
Beispiel #6
0
 def test_issubset_true_repeated(self):
     self.assertTrue(
         is_subset([1, 2, 3, 3, 1, 2, 1, 2, 4, 2, 3, 2, 4, 2, 2, 4],
                   [1, 2, 3, 2, 2, 2, 1, 2, 3, 4, 2, 2, 1, 2]))
Beispiel #7
0
 def test_issubset_false(self):
     self.assertFalse(is_subset([1, 2, 3, 4], [1, 2, 3, 4, 5, 6]), False)
Beispiel #8
0
 def test_issubset_true(self):
     self.assertEqual(is_subset([1, 2, 3, 34], [1, 2, 3]), True)