def test_to_base_n_with_unknown_base_raise_exception(self): try: to_base_n(892103712, 86) except AssertionError: pass try: to_base_n(892103712, 16522) except AssertionError: pass try: to_base_n(892103712, 1) except AssertionError: pass
def test_base36_is_idempotent(self): for i in [0, 63, 782963129, 99999999, 2147483647]: assert i == to_base10(to_base_n(i, 36), 36)
def test_base64_is_idempotent(self): for i in [0, 63, 782963129, 99999999, 2147483647]: assert i == to_base10(to_base_n(i, 64), 64)