def func(a): h1 = create_fitsheader(a.shape[::-1], dtype=float if a.ndim > 0 else np.int32) h2 = create_fitsheader_for(a if a.ndim > 0 else None) assert h1 == h2 assert h1['NAXIS'] == a.ndim for i, s in enumerate(a.shape[::-1]): assert h1['NAXIS'+str(i+1)] == s
def test_create_fitsheader2(): header = create_fitsheader_for(None) assert header['NAXIS'] == 0