def test_example():
    """Tests using the given example in task"""
    arr, min, max = [1, 3, 1, 4], 1, 2
    count = count_pairs(list_arr=arr, min=min, max=max)
    log.info('list_arr:{}, min:{}, max:{} -> count:{}'.format(
        arr, min, max, count))
    assert count == 2
def test_case_3():
    arr, min, max = [1, 2, 1, 6, 3], 2, 4
    count = count_pairs(list_arr=arr, min=min, max=max)
    log.info('list_arr:{}, min:{}, max:{} -> count:{}'.format(
        arr, min, max, count))
    assert count == 3
Exemple #3
0
 def test_count_pairs_2(self):
     result = count_pairs([1, 1, 2, 2], 1, 2)
     self.assertEqual(result, 1)
Exemple #4
0
 def test_count_pairs_1(self):
     result = count_pairs([1, 3, 1, 4], 1, 2)
     self.assertEqual(result, 2)
Exemple #5
0
 def test_count_pairs_4(self):
     result = count_pairs([1, 2, 1, 6, 3], 2, 4)
     self.assertEqual(result, 3)
Exemple #6
0
 def test_count_pairs_3(self):
     result = count_pairs([1, 1, 2, 2, 3], 2, 4)
     self.assertEqual(result, 1)