示例#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)