from unittest import TestCase from benchmark.common_divisor_count import cd_count class Test_cd_count(TestCase): # distances_true = {1: [5], 2: [618], 3: [6], 4: [619], 5: [0, 0, 0, 0, 1], 6: [0], 7: [0]} # distances_false = {1: [0], 2: [0], 3: [0], 4: [0], 5: [5, 3, 2, 1, 0], 6: [1], 7: [1]} def test_cd_count_1(self): assert cd_count(a=5, b=618) == 1 # distances_true = {1: [0]} # distances_false = {1: [1]} def test_cd_count_2(self): assert cd_count(a=0, b=-49) == 2 # distances_true = {1: [4], 2: [101], 3: [5], 4: [0], 5: [0, 0, 1], 6: [0], 7: [0]} # distances_false = {1: [0], 2: [0], 3: [0], 4: [101], 5: [4, 1, 0], 6: [1], 7: [1]} def test_cd_count_3(self): assert cd_count(a=4, b=-101) == 1 # distances_true = {1: [10], 2: [52], 3: [0], 4: [0], 5: [0, 0, 1], 6: [0], 7: [1]} # distances_false = {1: [0], 2: [0], 3: [10], 4: [52], 5: [10, 2, 0], 6: [1], 7: [0]} def test_cd_count_4(self): assert cd_count(a=-10, b=-52) == 2 # distances_true = {1: [9], 2: [0]} # distances_false = {1: [0], 2: [1]} def test_cd_count_5(self): assert cd_count(a=9, b=0) == 2 # distances_true = {1: [10], 2: [150], 3: [0], 4: [0], 5: [0, 1], 6: [0, 0, 1], 7: [9, 3]} # distances_false = {1: [0], 2: [0], 3: [10], 4: [150], 5: [10, 0], 6: [1, 1, 0], 7: [0, 0]} def test_cd_count_6(self): assert cd_count(a=-10, b=-150) == 4