Пример #1
0
 def test_bag_array4(self):
     bag = BagArray()
     self.assertEqual(0, bag.size())
     self.assertTrue(bag.is_empty())
     for i in range(32):
         bag.add(i)
     bag.add(32)
     self.assertEqual(33, bag.size())
     self.assertFalse(bag.is_empty())
Пример #2
0
 def test_bag_array3(self):
     bag = BagArray()
     self.assertEqual(0, bag.size())
     self.assertTrue(bag.is_empty())
     bag.add(1)
     self.assertEqual(1, bag.size())
     self.assertFalse(bag.is_empty())
Пример #3
0
 def test_bag_array(self):
     # initialize an object
     s = BagArray()
     self.assertEqual(s.is_empty(), True)
Пример #4
0
 def test_bag_array2(self):
     # initialize an object
     s = BagArray()
     s.add(1)
     self.assertEqual(s.is_empty(), False)
     self.assertEqual(s.size(), 1)