BagUnitTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_bag() 0 12 2
1
import unittest
2
3
from pyalgs.data_structures.commons.bag import Bag
4
5
6
class BagUnitTest(unittest.TestCase):
7
    def test_bag(self):
8
        bag = Bag.create()
9
10
        bag.add(100)
11
        bag.add(200)
12
        bag.add(300)
13
        bag.add(400)
14
15
        print([i for i in bag.iterate()])
16
17
        self.assertEqual(4, bag.size())
18
        self.assertFalse(bag.is_empty())
19
20
if __name__ == '__main__':
21
    unittest.main()
22