Changeset 3524 for nappy/trunk


Ignore:
Timestamp:
26/02/08 19:36:35 (12 years ago)
Author:
astephen
Message:

Fixed, renewed and added tests.

Location:
nappy/trunk/nappy/unit_tests
Files:
1 deleted
11 edited
3 copied

Legend:

Unmodified
Added
Removed
  • nappy/trunk/nappy/unit_tests/00README.txt

    r3400 r3524  
    3131$ nosetests __init__.py  
    3232 
    33 and it runs all tests. 
     33and it runs all tests that match "test_*.py" 
  • nappy/trunk/nappy/unit_tests/test_na_file_1001.py

    r3425 r3524  
    2323        self.infile = os.path.join(base_dir, "data_files", "1001.na") 
    2424        self.outfile = os.path.join(base_dir, "test_outputs", "test_1001.na") 
     25        self.out_csv = os.path.join(base_dir, "test_outputs", "test_1001.csv") 
    2526        self.fin = nappy.openNAFile(self.infile) 
    2627        self.fin.readData() 
     
    3334    def test_write1001(self): 
    3435        "Tests writing FFI 1001." 
    35         self.fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)               
    36         self.fobj.write() 
    37         self.failUnless(isinstance(self.fobj, nappy.na_file.na_file.NAFile)) 
     36        fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)            
     37        fobj.write() 
     38        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     39 
     40    def test_writeAnnotatedCSV1001(self): 
     41        "Tests conversion to NetCDF." 
     42        fobj = nappy.openNAFile(self.out_csv, mode="w", na_dict=self.na_dict) 
     43        fobj.write(delimiter=",", float_format="%.2d", annotation=True) 
     44        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     45  
    3846 
    3947if __name__ ==  "__main__": 
  • nappy/trunk/nappy/unit_tests/test_na_file_1010.py

    r3425 r3524  
    2323        self.infile = os.path.join(base_dir, "data_files", "1010.na") 
    2424        self.outfile = os.path.join(base_dir, "test_outputs", "test_1010.na") 
     25        self.out_csv = os.path.join(base_dir, "test_outputs", "test_1010.csv") 
    2526        self.fin = nappy.openNAFile(self.infile) 
    2627        self.fin.readData() 
     
    3334    def test_write1010(self): 
    3435        "Tests writing FFI 1010." 
    35         self.fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)               
    36         self.fobj.write() 
    37         self.failUnless(isinstance(self.fobj, nappy.na_file.na_file.NAFile)) 
     36        fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)            
     37        fobj.write() 
     38        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     39 
     40    def test_writeAnnotatedCSV1010(self): 
     41        "Tests conversion to NetCDF." 
     42        fobj = nappy.openNAFile(self.out_csv, mode="w", na_dict=self.na_dict) 
     43        fobj.write(delimiter=",", float_format="%.2d", annotation=True) 
     44        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     45  
    3846 
    3947if __name__ ==  "__main__": 
  • nappy/trunk/nappy/unit_tests/test_na_file_1020.py

    r3425 r3524  
    2323        self.infile = os.path.join(base_dir, "data_files", "1020.na") 
    2424        self.outfile = os.path.join(base_dir, "test_outputs", "test_1020.na") 
     25        self.out_csv = os.path.join(base_dir, "test_outputs", "test_1020.csv") 
    2526        self.fin = nappy.openNAFile(self.infile) 
    2627        self.fin.readData() 
     
    3334    def test_write1020(self): 
    3435        "Tests writing FFI 1020." 
    35         self.fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)               
    36         self.fobj.write() 
    37         self.failUnless(isinstance(self.fobj, nappy.na_file.na_file.NAFile)) 
     36        fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)            
     37        fobj.write() 
     38        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     39 
     40    def test_writeAnnotatedCSV1020(self): 
     41        "Tests conversion to NetCDF." 
     42        fobj = nappy.openNAFile(self.out_csv, mode="w", na_dict=self.na_dict) 
     43        fobj.write(delimiter=",", float_format="%.2d", annotation=True) 
     44        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     45  
    3846 
    3947if __name__ ==  "__main__": 
  • nappy/trunk/nappy/unit_tests/test_na_file_2010.py

    r3425 r3524  
    2323        self.infile = os.path.join(base_dir, "data_files", "2010.na") 
    2424        self.outfile = os.path.join(base_dir, "test_outputs", "test_2010.na") 
     25        self.out_csv = os.path.join(base_dir, "test_outputs", "test_2010.csv") 
    2526        self.fin = nappy.openNAFile(self.infile) 
    2627        self.fin.readData() 
     
    3334    def test_write2010(self): 
    3435        "Tests writing FFI 2010." 
    35         self.fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)               
    36         self.fobj.write() 
    37         self.failUnless(isinstance(self.fobj, nappy.na_file.na_file.NAFile)) 
     36        fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)            
     37        fobj.write() 
     38        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     39 
     40    def test_writeAnnotatedCSV2010(self): 
     41        "Tests conversion to NetCDF." 
     42        fobj = nappy.openNAFile(self.out_csv, mode="w", na_dict=self.na_dict) 
     43        fobj.write(delimiter=",", float_format="%.2d", annotation=True) 
     44        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     45  
    3846 
    3947if __name__ ==  "__main__": 
  • nappy/trunk/nappy/unit_tests/test_na_file_2110.py

    r3425 r3524  
    2323        self.infile = os.path.join(base_dir, "data_files", "2110.na") 
    2424        self.outfile = os.path.join(base_dir, "test_outputs", "test_2110.na") 
     25        self.out_csv = os.path.join(base_dir, "test_outputs", "test_2110.csv") 
    2526        self.fin = nappy.openNAFile(self.infile) 
    2627        self.fin.readData() 
     
    3334    def test_write2110(self): 
    3435        "Tests writing FFI 2110." 
    35         self.fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)               
    36         self.fobj.write() 
    37         self.failUnless(isinstance(self.fobj, nappy.na_file.na_file.NAFile)) 
     36        fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)            
     37        fobj.write() 
     38        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     39 
     40    def test_writeAnnotatedCSV2110(self): 
     41        "Tests conversion to NetCDF." 
     42        fobj = nappy.openNAFile(self.out_csv, mode="w", na_dict=self.na_dict) 
     43        fobj.write(delimiter=",", float_format="%.2d", annotation=True) 
     44        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     45  
    3846 
    3947if __name__ ==  "__main__": 
  • nappy/trunk/nappy/unit_tests/test_na_file_2160.py

    r3425 r3524  
    2323        self.infile = os.path.join(base_dir, "data_files", "2160.na") 
    2424        self.outfile = os.path.join(base_dir, "test_outputs", "test_2160.na") 
     25        self.out_csv = os.path.join(base_dir, "test_outputs", "test_2160.csv") 
    2526        self.fin = nappy.openNAFile(self.infile) 
    2627        self.fin.readData() 
     
    3334    def test_write2160(self): 
    3435        "Tests writing FFI 2160." 
    35         self.fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)               
    36         self.fobj.write() 
    37         self.failUnless(isinstance(self.fobj, nappy.na_file.na_file.NAFile)) 
     36        fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)            
     37        fobj.write() 
     38        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     39 
     40    def test_writeAnnotatedCSV2160(self): 
     41        "Tests conversion to NetCDF." 
     42        fobj = nappy.openNAFile(self.out_csv, mode="w", na_dict=self.na_dict) 
     43        fobj.write(delimiter=",", float_format="%.2d", annotation=True) 
     44        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     45  
    3846 
    3947if __name__ ==  "__main__": 
  • nappy/trunk/nappy/unit_tests/test_na_file_2310.py

    r3425 r3524  
    2323        self.infile = os.path.join(base_dir, "data_files", "2310.na") 
    2424        self.outfile = os.path.join(base_dir, "test_outputs", "test_2310.na") 
     25        self.out_csv = os.path.join(base_dir, "test_outputs", "test_2310.csv") 
    2526        self.fin = nappy.openNAFile(self.infile) 
    2627        self.fin.readData() 
     
    3334    def test_write2310(self): 
    3435        "Tests writing FFI 2310." 
    35         self.fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)               
    36         self.fobj.write() 
    37         self.failUnless(isinstance(self.fobj, nappy.na_file.na_file.NAFile)) 
     36        fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)            
     37        fobj.write() 
     38        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     39 
     40    def test_writeAnnotatedCSV2310(self): 
     41        "Tests conversion to NetCDF." 
     42        fobj = nappy.openNAFile(self.out_csv, mode="w", na_dict=self.na_dict) 
     43        fobj.write(delimiter=",", float_format="%.2d", annotation=True) 
     44        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     45  
    3846 
    3947if __name__ ==  "__main__": 
  • nappy/trunk/nappy/unit_tests/test_na_file_3010.py

    r3425 r3524  
    2323        self.infile = os.path.join(base_dir, "data_files", "3010.na") 
    2424        self.outfile = os.path.join(base_dir, "test_outputs", "test_3010.na") 
     25        self.out_csv = os.path.join(base_dir, "test_outputs", "test_3010.csv") 
    2526        self.fin = nappy.openNAFile(self.infile) 
    2627        self.fin.readData() 
     
    3334    def test_write3010(self): 
    3435        "Tests writing FFI 3010." 
    35         self.fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)               
    36         self.fobj.write() 
    37         self.failUnless(isinstance(self.fobj, nappy.na_file.na_file.NAFile)) 
     36        fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)            
     37        fobj.write() 
     38        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     39 
     40    def test_writeAnnotatedCSV3010(self): 
     41        "Tests conversion to NetCDF." 
     42        fobj = nappy.openNAFile(self.out_csv, mode="w", na_dict=self.na_dict) 
     43        fobj.write(delimiter=",", float_format="%.2d", annotation=True) 
     44        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     45  
    3846 
    3947if __name__ ==  "__main__": 
  • nappy/trunk/nappy/unit_tests/test_na_file_4010.py

    r3425 r3524  
    2323        self.infile = os.path.join(base_dir, "data_files", "4010.na") 
    2424        self.outfile = os.path.join(base_dir, "test_outputs", "test_4010.na") 
     25        self.out_csv = os.path.join(base_dir, "test_outputs", "test_4010.csv") 
    2526        self.fin = nappy.openNAFile(self.infile) 
    2627        self.fin.readData() 
     
    3334    def test_write4010(self): 
    3435        "Tests writing FFI 4010." 
    35         self.fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)               
    36         self.fobj.write() 
    37         self.failUnless(isinstance(self.fobj, nappy.na_file.na_file.NAFile)) 
     36        fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)            
     37        fobj.write() 
     38        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     39 
     40    def test_writeAnnotatedCSV4010(self): 
     41        "Tests conversion to NetCDF." 
     42        fobj = nappy.openNAFile(self.out_csv, mode="w", na_dict=self.na_dict) 
     43        fobj.write(delimiter=",", float_format="%.2d", annotation=True) 
     44        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     45  
    3846 
    3947if __name__ ==  "__main__": 
  • nappy/trunk/nappy/unit_tests/test_na_file_template.txt

    r3425 r3524  
    2323        self.infile = os.path.join(base_dir, "data_files", "<FFI>.na") 
    2424        self.outfile = os.path.join(base_dir, "test_outputs", "test_<FFI>.na") 
     25        self.out_csv = os.path.join(base_dir, "test_outputs", "test_<FFI>.csv") 
    2526        self.fin = nappy.openNAFile(self.infile) 
    2627        self.fin.readData() 
     
    3334    def test_write<FFI>(self): 
    3435        "Tests writing FFI <FFI>." 
    35         self.fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)               
    36         self.fobj.write() 
    37         self.failUnless(isinstance(self.fobj, nappy.na_file.na_file.NAFile)) 
     36        fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict)            
     37        fobj.write() 
     38        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     39 
     40    def test_writeAnnotatedCSV<FFI>(self): 
     41        "Tests conversion to NetCDF." 
     42        fobj = nappy.openNAFile(self.out_csv, mode="w", na_dict=self.na_dict) 
     43        fobj.write(delimiter=",", float_format="%.2d", annotation=True) 
     44        self.failUnless(isinstance(fobj, nappy.na_file.na_file.NAFile)) 
     45  
    3846 
    3947if __name__ ==  "__main__": 
Note: See TracChangeset for help on using the changeset viewer.