def test_from_number(self): f = [10, -12, 123456789] r_f = [ IntFormat(3, repeat=26), IntFormat(4, repeat=20), IntFormat(10, repeat=8) ] for i, j in zip(f, r_f): assert_equal(IntFormat.from_number(i).__dict__, j.__dict__)
def test_to_fortran(self): f = [IntFormat(10), IntFormat(12, 10), IntFormat(12, 10, 3)] res = ["(I10)", "(I12.10)", "(3I12.10)"] for i, j in zip(f, res): assert_equal(i.fortran_format, j)
def test_simple_repeated_int(self): self._test_equal("(3I4)", IntFormat(4, repeat=3))
def test_simple_int(self): self._test_equal("(I4)", IntFormat(4))