def test_cases_from_problemt_statement(self): self.assertEqual(count_numbers([9, 2]), 3) self.assertEqual(count_numbers([8, 2]), 3) self.assertEqual(count_numbers([50]), 1) self.assertEqual(count_numbers([1, 5, 8, 30, 15, 4]), 11) self.assertEqual(count_numbers([1, 2, 4, 8, 16, 32, 64]), 7) self.assertEqual(count_numbers([6, 2, 18]), 7) self.assertEqual(count_numbers([]),0)
def test_cases_from_problemt_statement(self): self.assertEqual(count_numbers([9, 2]), 3) self.assertEqual(count_numbers([8, 2]), 3) self.assertEqual(count_numbers([50]), 1) self.assertEqual(count_numbers([1, 5, 8, 30, 15, 4]), 11) self.assertEqual(count_numbers([1, 2, 4, 8, 16, 32, 64]), 7) self.assertEqual(count_numbers([6, 2, 18]), 7)
def test_count_numbers(self): self.assertEqual(3, count_numbers([9, 2])) self.assertEqual(3, count_numbers([8, 2])) self.assertEqual(1, count_numbers([50])) self.assertEqual(11, count_numbers([1, 5, 8, 30, 15, 4])) self.assertEqual(7, count_numbers([1, 2, 4, 8, 16, 32, 64])) self.assertEqual(7, count_numbers([6, 2, 18]))
def test_with_top_coder_examples(self): self.assertEqual(solution.count_numbers([9, 2]), 3) self.assertEqual(solution.count_numbers([8, 2]), 3) self.assertEqual(solution.count_numbers([50]), 1) self.assertEqual(solution.count_numbers([1, 5, 8, 30, 15, 4]), 11) self.assertEqual(solution.count_numbers([1, 2, 4, 8, 16, 32, 64]), 7) self.assertEqual(solution.count_numbers([6, 2, 18]), 7)
def test_division_by_zero_2(self): self.assertEqual(3, solution.count_numbers([8, 2]))
def test_division_by_zero_7(self): self.assertEqual(10, solution.count_numbers([5, 3, 28, 6, 7]))
def test_division_by_zero_6(self): self.assertEqual(7, solution.count_numbers([6, 2, 18]))
def test_division_by_zero_5(self): self.assertEqual(7, solution.count_numbers([1, 2, 4, 8, 16, 32, 64]))
def test_division_by_zero_4(self): self.assertEqual(11, solution.count_numbers([1, 5, 8, 30, 15, 4]))
def test_division_by_zero_3(self): self.assertEqual(1, solution.count_numbers([50]), 1)
def test_null(self): self.assertEqual(3, count_numbers([9, 2]))
def test_five(self): self.assertEqual(7, count_numbers([6, 2, 18]))
def test_four(self): self.assertEqual(7, count_numbers([1, 2, 4, 8, 16, 32, 64]))
def test_three(self): self.assertEqual(11, count_numbers([1, 5, 8, 30, 15, 4]))
def test_two(self): self.assertEqual(1, count_numbers([50]))
def test_one(self): self.assertEqual(3, count_numbers([8, 2]))