예제 #1
0
 def test_issubset_invalid_input(self):
     with self.assertRaises(TypeError):
         is_subset(['q', 'qe', 1, 2, 3], [1, 23, 3, 4, 54])
예제 #2
0
 def test_issubset_rhs_empty(self):
     self.assertTrue(is_subset([1, 3, 3, 4, 3, 2, 3, 3, 4], []))
예제 #3
0
 def test_issubset_lhs_empty(self):
     self.assertFalse(is_subset([], [1, 32, 4, 3, 2]))
예제 #4
0
 def test_issubset_empty_sets(self):
     self.assertTrue(is_subset([], []))
예제 #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]))
예제 #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]))
예제 #7
0
 def test_issubset_false(self):
     self.assertFalse(is_subset([1, 2, 3, 4], [1, 2, 3, 4, 5, 6]), False)
예제 #8
0
 def test_issubset_true(self):
     self.assertEqual(is_subset([1, 2, 3, 34], [1, 2, 3]), True)