def test_normalize_does_not_change_multiplicative_persistence(testcase): assert persistence(normalize(testcase)) == persistence(testcase)
def test_normalize_correctly_handles_inputs_which_are_all_1s(): assert normalize(111111) == (0, )
def test_normalize_of_numbers_containing_0_is_always_0(testcase): assume(0 in testcase) assert normalize(testcase) == (0, )
def test_normalize_ignores_ones(testcase): assert normalize(testcase) == behaviourExpected
def test_normalize_output_is_the_same_regardless_of_order_of_digit_tuples(testcase): assert normalize(testcase) == behaviourExpected
def test_normalize_correctly_processes_multi_digit_numbers(testcase, expected): assert normalize(testcase) == expected
def test_normalize_processes_numbers_and_tuples_identically(testcase): assert normalize(testcase) == normalize(tuple(map(int, str(testcase))))
def test_normalize_correctly_processes_single_digit_composites(testcase, expected): assert normalize(testcase) == expected
def test_normalize_correctly_processes_single_digit_primes(testcase): assert normalize(testcase) == (testcase, )
def test_normalize_rejects_negative_digit_tuples(testcase): with pytest.raises(ValueError): normalize(testcase)
def test_normalize_rejects_digit_tuples_greater_than_9(testcase): with pytest.raises(ValueError): normalize(testcase)
def test_normalize_rejects_bad_types(testcase): with pytest.raises(TypeError): normalize(testcase)