import unittest from Numeric import allclose, asarray import most2nc from Scientific.IO.NetCDF import NetCDFFile class Test_most2nc(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_small_nxn(self): most2nc.most2nc(input_file='small.txt',output_file='test.nc'\ ,inverted_bathymetry = False,verbose = False) fid = NetCDFFile('test.nc') elevation = fid.variables['ELEVATION'][:] fid.close() z=[[-13., -14., -15., -16.]\ ,[-9., -10., -11., -12.]\ ,[-5., -6., -7., -8.]\ ,[-1., -2., -3., -4.]] z = asarray(z) assert allclose(z,elevation) import os os.remove('test.nc')