BinarySelectionUnitTest.test_select()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
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