def test_smallest_factor():
    assert soln.smallest_factor(4) == 2, 'Range is too small'
    assert soln.smallest_factor(6) == 2, 'Range is too small'
    assert soln.smallest_factor(8) == 2, 'Range is too small'

    assert soln.smallest_factor(1) == 1, 'One fails'
    assert soln.smallest_factor(5) == 5, 'Primes fail'
Esempio n. 2
0
def test_smallest_factor():
    assert soln.smallest_factor(10) == 2, "Incorrect!"
    assert soln.smallest_factor(3) == 3, "Incorrect!"
    assert soln.smallest_factor(1) == 1, "Incorrect!"
Esempio n. 3
0
def test_smallest_factor():
    assert soln.smallest_factor(10) == 2, "inc"
    assert soln.smallest_factor(3) == 3, "inc"
Esempio n. 4
0
def test_smallest_factor():
    assert soln.smallest_factor(2) == 2
    assert soln.smallest_factor(121) == 11 
    assert soln.smallest_factor(1) == 1
Esempio n. 5
0
def test_smallest_factor():
    assert soln.smallest_factor(1) == 1, "Failed for 1"
    assert soln.smallest_factor(2) == 2, "Failed for 2"
    assert soln.smallest_factor(6) == 2, "Failed for composite number"
    assert soln.smallest_factor(7) == 7, "Failed for prime number"
    assert soln.smallest_factor(9) == 3, "Failed for squared number"
Esempio n. 6
0
def test_smallest_factor():
    assert soln.smallest_factor(1) == 1, "when n = 1"
    assert soln.smallest_factor(2) == 2, "when n = 2"
    assert soln.smallest_factor(3) == 3, "when n = 3"
    assert soln.smallest_factor(4) == 2, "when n = 4"
    assert soln.smallest_factor(6) == 2, "when n = 6"