BinarySelectionUnitTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_select() 0 4 2
1
import unittest
2
3
from pyalgs.algorithms.commons.selecting import BinarySelection
4
from pyalgs.algorithms.commons.util import is_sorted
5
6
7
class BinarySelectionUnitTest(unittest.TestCase):
8
    def test_select(self):
9
        a = [1, 2, 13, 22, 123]
10
        assert is_sorted(a)
11
        print(BinarySelection.index_of(a, 13))
12
13
if __name__ == '__main__':
14
    unittest.main()
15