Пример #1
0
 def test_complexity_range_1000(self, range_1000):
     with get_counter(var_counter, recursive_get_index_binary) as counter:
         for value in range_1000:
             recursive_get_index_binary(data=range_1000, value=value)
     assert counter.value == 8987
Пример #2
0
 def test_range(self, range_1000, value: int):
     with get_counter(var_counter, recursive_get_index_binary) as counter:
         index = recursive_get_index_binary(data=range_1000, value=value)
     assert index is not None
     assert index == value - 1000
     assert 1 <= counter.value <= 10
Пример #3
0
 def test_after(self, range_1000):
     with get_counter(var_counter, recursive_get_index_binary) as counter:
         value = 2000
         index = recursive_get_index_binary(data=range_1000, value=value)
     assert index is None
     assert counter.value == 10
Пример #4
0
 def test_before(self, range_1000):
     with get_counter(var_counter, get_index_binary) as counter:
         value = -1
         index = get_index_binary(data=range_1000, value=value)
     assert index is None
     assert counter.value == 9