Changeset 5072


Ignore:
Timestamp:
06/03/09 14:48:47 (10 years ago)
Author:
spascoe
Message:

Moved tests back out of the package hierarchy. They are now not
included in the egg but can be run from a checkout or a
distribution directory created with "easy_install -eb . nappy"

To run the tests do "python setup.py test" or "nosetests" from the
checkout.

Location:
nappy/branches/nappy-eggable/tests
Files:
12 edited
1 moved

Legend:

Unmodified
Added
Removed
  • nappy/branches/nappy-eggable/tests/test_1010_to_1020.py

    r5068 r5072  
    66 
    77print "Converting NAFile to NC file 1010.na" 
    8 ncfile = os.path.join(os.path.dirname(__file__), "../../test_outputs/1010.nc") 
    9 nafile = os.path.join(os.path.dirname(__file__), "../../data_files/1010.na") 
    10 ncOutFile = os.path.join(os.path.dirname(__file__), "../../test_outputs/1010_edited_for_1020.nc") 
     8ncfile = os.path.join(os.path.dirname(__file__), "../test_outputs/1010.nc") 
     9nafile = os.path.join(os.path.dirname(__file__), "../data_files/1010.na") 
     10ncOutFile = os.path.join(os.path.dirname(__file__), "../test_outputs/1010_edited_for_1020.nc") 
    1111 
    1212n = nappy.nc_interface.na_to_nc.NAToNC(nafile) 
     
    2424print "Outfile written:", ncfile 
    2525 
    26 out_dir = os.path.join(os.path.dirname(__file__), '../../test_outputs') 
     26out_dir = os.path.join(os.path.dirname(__file__), '../test_outputs') 
    2727 
    2828ffi_in, ffi_out = (1010, 1020) 
  • nappy/branches/nappy-eggable/tests/test_2010_to_2110.py

    r5068 r5072  
    33import os 
    44 
    5  
    6 in_dir = out_dir = os.path.join(os.path.dirname(__file__), "../../test_outputs") 
     5in_dir = out_dir = os.path.join(os.path.dirname(__file__), "../test_outputs") 
    76 
    87ffi_in, ffi_out = (2010, 2110) 
  • nappy/branches/nappy-eggable/tests/test_2010_to_2310.py

    r5068 r5072  
    33import os 
    44 
    5 in_dir = out_dir = os.path.join(os.path.dirname(__file__), "../../test_outputs") 
     5in_dir = out_dir = os.path.join(os.path.dirname(__file__), "../test_outputs") 
    66 
    77 
  • nappy/branches/nappy-eggable/tests/test_na_file_1001.py

    r3628 r5072  
    1212import sys 
    1313 
    14 # Import local modules 
    15 base_dir = os.environ.get("NAPPY_BASE_DIR", "../..") 
    16 sys.path.append(base_dir) 
    17  
    1814import nappy 
    1915import nappy.utils.compare_na 
     16 
     17here = os.path.dirname(__file__) 
     18data_files = os.path.join(here, '../data_files') 
     19test_outputs = os.path.join(here, '../test_outputs') 
    2020 
    2121class NAFile1001_TestCase(unittest.TestCase): 
    2222 
    2323    def setUp(self): 
    24         self.infile = os.path.join(base_dir, "data_files", "1001.na") 
    25         self.outfile = os.path.join(base_dir, "test_outputs", "test_1001.na") 
    26         self.out_csv = os.path.join(base_dir, "test_outputs", "test_1001.csv") 
    27         self.out_csv_annotated = os.path.join(base_dir, "test_outputs", "test_1001_annotated.csv") 
     24        self.infile = os.path.join(data_files, "1001.na") 
     25        self.outfile = os.path.join(test_outputs, "test_1001.na") 
     26        self.out_csv = os.path.join(test_outputs, "test_1001.csv") 
     27        self.out_csv_annotated = os.path.join(test_outputs, "test_1001_annotated.csv") 
    2828        self.fin = nappy.openNAFile(self.infile) 
    2929        self.fin.readData() 
  • nappy/branches/nappy-eggable/tests/test_na_file_1010.py

    r3628 r5072  
    1212import sys 
    1313 
    14 # Import local modules 
    15 base_dir = os.environ.get("NAPPY_BASE_DIR", "../..") 
    16 sys.path.append(base_dir) 
    17  
    1814import nappy 
    1915import nappy.utils.compare_na 
     16 
     17here = os.path.dirname(__file__) 
     18data_files = os.path.join(here, '../data_files') 
     19test_outputs = os.path.join(here, '../test_outputs') 
     20 
    2021 
    2122class NAFile1010_TestCase(unittest.TestCase): 
    2223 
    2324    def setUp(self): 
    24         self.infile = os.path.join(base_dir, "data_files", "1010.na") 
    25         self.outfile = os.path.join(base_dir, "test_outputs", "test_1010.na") 
    26         self.out_csv = os.path.join(base_dir, "test_outputs", "test_1010.csv") 
    27         self.out_csv_annotated = os.path.join(base_dir, "test_outputs", "test_1010_annotated.csv") 
     25        self.infile = os.path.join(data_files, "1010.na") 
     26        self.outfile = os.path.join(test_outputs, "test_1010.na") 
     27        self.out_csv = os.path.join(test_outputs, "test_1010.csv") 
     28        self.out_csv_annotated = os.path.join(test_outputs, "test_1010_annotated.csv") 
    2829        self.fin = nappy.openNAFile(self.infile) 
    2930        self.fin.readData() 
  • nappy/branches/nappy-eggable/tests/test_na_file_1020.py

    r3628 r5072  
    1212import sys 
    1313 
    14 # Import local modules 
    15 base_dir = os.environ.get("NAPPY_BASE_DIR", "../..") 
    16 sys.path.append(base_dir) 
    17  
    1814import nappy 
    1915import nappy.utils.compare_na 
     16 
     17here = os.path.dirname(__file__) 
     18data_files = os.path.join(here, '../data_files') 
     19test_outputs = os.path.join(here, '../test_outputs') 
    2020 
    2121class NAFile1020_TestCase(unittest.TestCase): 
    2222 
    2323    def setUp(self): 
    24         self.infile = os.path.join(base_dir, "data_files", "1020.na") 
    25         self.outfile = os.path.join(base_dir, "test_outputs", "test_1020.na") 
    26         self.out_csv = os.path.join(base_dir, "test_outputs", "test_1020.csv") 
    27         self.out_csv_annotated = os.path.join(base_dir, "test_outputs", "test_1020_annotated.csv") 
     24        self.infile = os.path.join(data_files, "1020.na") 
     25        self.outfile = os.path.join(test_outputs, "test_1020.na") 
     26        self.out_csv = os.path.join(test_outputs, "test_1020.csv") 
     27        self.out_csv_annotated = os.path.join(test_outputs, "test_1020_annotated.csv") 
    2828        self.fin = nappy.openNAFile(self.infile) 
    2929        self.fin.readData() 
  • nappy/branches/nappy-eggable/tests/test_na_file_2010.py

    r3628 r5072  
    1212import sys 
    1313 
    14 # Import local modules 
    15 base_dir = os.environ.get("NAPPY_BASE_DIR", "../..") 
    16 sys.path.append(base_dir) 
    17  
    1814import nappy 
    1915import nappy.utils.compare_na 
     16 
     17here = os.path.dirname(__file__) 
     18data_files = os.path.join(here, '../data_files') 
     19test_outputs = os.path.join(here, '../test_outputs') 
    2020 
    2121class NAFile2010_TestCase(unittest.TestCase): 
    2222 
    2323    def setUp(self): 
    24         self.infile = os.path.join(base_dir, "data_files", "2010.na") 
    25         self.outfile = os.path.join(base_dir, "test_outputs", "test_2010.na") 
    26         self.out_csv = os.path.join(base_dir, "test_outputs", "test_2010.csv") 
    27         self.out_csv_annotated = os.path.join(base_dir, "test_outputs", "test_2010_annotated.csv") 
     24        self.infile = os.path.join(data_files, "2010.na") 
     25        self.outfile = os.path.join(test_outputs, "test_2010.na") 
     26        self.out_csv = os.path.join(test_outputs, "test_2010.csv") 
     27        self.out_csv_annotated = os.path.join(test_outputs, "test_2010_annotated.csv") 
    2828        self.fin = nappy.openNAFile(self.infile) 
    2929        self.fin.readData() 
  • nappy/branches/nappy-eggable/tests/test_na_file_2110.py

    r3628 r5072  
    1212import sys 
    1313 
    14 # Import local modules 
    15 base_dir = os.environ.get("NAPPY_BASE_DIR", "../..") 
    16 sys.path.append(base_dir) 
    17  
    1814import nappy 
    1915import nappy.utils.compare_na 
     16 
     17here = os.path.dirname(__file__) 
     18data_files = os.path.join(here, '../data_files') 
     19test_outputs = os.path.join(here, '../test_outputs') 
    2020 
    2121class NAFile2110_TestCase(unittest.TestCase): 
    2222 
    2323    def setUp(self): 
    24         self.infile = os.path.join(base_dir, "data_files", "2110.na") 
    25         self.outfile = os.path.join(base_dir, "test_outputs", "test_2110.na") 
    26         self.out_csv = os.path.join(base_dir, "test_outputs", "test_2110.csv") 
    27         self.out_csv_annotated = os.path.join(base_dir, "test_outputs", "test_2110_annotated.csv") 
     24        self.infile = os.path.join(data_files, "2110.na") 
     25        self.outfile = os.path.join(test_outputs, "test_2110.na") 
     26        self.out_csv = os.path.join(test_outputs, "test_2110.csv") 
     27        self.out_csv_annotated = os.path.join(test_outputs, "test_2110_annotated.csv") 
    2828        self.fin = nappy.openNAFile(self.infile) 
    2929        self.fin.readData() 
  • nappy/branches/nappy-eggable/tests/test_na_file_2160.py

    r3628 r5072  
    1212import sys 
    1313 
    14 # Import local modules 
    15 base_dir = os.environ.get("NAPPY_BASE_DIR", "../..") 
    16 sys.path.append(base_dir) 
    17  
    1814import nappy 
    1915import nappy.utils.compare_na 
     16 
     17here = os.path.dirname(__file__) 
     18data_files = os.path.join(here, '../data_files') 
     19test_outputs = os.path.join(here, '../test_outputs') 
    2020 
    2121class NAFile2160_TestCase(unittest.TestCase): 
    2222 
    2323    def setUp(self): 
    24         self.infile = os.path.join(base_dir, "data_files", "2160.na") 
    25         self.outfile = os.path.join(base_dir, "test_outputs", "test_2160.na") 
    26         self.out_csv = os.path.join(base_dir, "test_outputs", "test_2160.csv") 
    27         self.out_csv_annotated = os.path.join(base_dir, "test_outputs", "test_2160_annotated.csv") 
     24        self.infile = os.path.join(data_files, "2160.na") 
     25        self.outfile = os.path.join(test_outputs, "test_2160.na") 
     26        self.out_csv = os.path.join(test_outputs, "test_2160.csv") 
     27        self.out_csv_annotated = os.path.join(test_outputs, "test_2160_annotated.csv") 
    2828        self.fin = nappy.openNAFile(self.infile) 
    2929        self.fin.readData() 
  • nappy/branches/nappy-eggable/tests/test_na_file_2310.py

    r3628 r5072  
    1212import sys 
    1313 
    14 # Import local modules 
    15 base_dir = os.environ.get("NAPPY_BASE_DIR", "../..") 
    16 sys.path.append(base_dir) 
    17  
    1814import nappy 
    1915import nappy.utils.compare_na 
     16 
     17here = os.path.dirname(__file__) 
     18data_files = os.path.join(here, '../data_files') 
     19test_outputs = os.path.join(here, '../test_outputs') 
    2020 
    2121class NAFile2310_TestCase(unittest.TestCase): 
    2222 
    2323    def setUp(self): 
    24         self.infile = os.path.join(base_dir, "data_files", "2310.na") 
    25         self.outfile = os.path.join(base_dir, "test_outputs", "test_2310.na") 
    26         self.out_csv = os.path.join(base_dir, "test_outputs", "test_2310.csv") 
    27         self.out_csv_annotated = os.path.join(base_dir, "test_outputs", "test_2310_annotated.csv") 
     24        self.infile = os.path.join(data_files, "2310.na") 
     25        self.outfile = os.path.join(test_outputs, "test_2310.na") 
     26        self.out_csv = os.path.join(test_outputs, "test_2310.csv") 
     27        self.out_csv_annotated = os.path.join(test_outputs, "test_2310_annotated.csv") 
    2828        self.fin = nappy.openNAFile(self.infile) 
    2929        self.fin.readData() 
  • nappy/branches/nappy-eggable/tests/test_na_file_3010.py

    r3628 r5072  
    1212import sys 
    1313 
    14 # Import local modules 
    15 base_dir = os.environ.get("NAPPY_BASE_DIR", "../..") 
    16 sys.path.append(base_dir) 
    17  
    1814import nappy 
    1915import nappy.utils.compare_na 
     16 
     17here = os.path.dirname(__file__) 
     18data_files = os.path.join(here, '../data_files') 
     19test_outputs = os.path.join(here, '../test_outputs') 
    2020 
    2121class NAFile3010_TestCase(unittest.TestCase): 
    2222 
    2323    def setUp(self): 
    24         self.infile = os.path.join(base_dir, "data_files", "3010.na") 
    25         self.outfile = os.path.join(base_dir, "test_outputs", "test_3010.na") 
    26         self.out_csv = os.path.join(base_dir, "test_outputs", "test_3010.csv") 
    27         self.out_csv_annotated = os.path.join(base_dir, "test_outputs", "test_3010_annotated.csv") 
     24        self.infile = os.path.join(data_files, "3010.na") 
     25        self.outfile = os.path.join(test_outputs, "test_3010.na") 
     26        self.out_csv = os.path.join(test_outputs, "test_3010.csv") 
     27        self.out_csv_annotated = os.path.join(test_outputs, "test_3010_annotated.csv") 
    2828        self.fin = nappy.openNAFile(self.infile) 
    2929        self.fin.readData() 
  • nappy/branches/nappy-eggable/tests/test_na_file_4010.py

    r3628 r5072  
    1212import sys 
    1313 
    14 # Import local modules 
    15 base_dir = os.environ.get("NAPPY_BASE_DIR", "../..") 
    16 sys.path.append(base_dir) 
    17  
    1814import nappy 
    1915import nappy.utils.compare_na 
     16 
     17here = os.path.dirname(__file__) 
     18data_files = os.path.join(here, '../data_files') 
     19test_outputs = os.path.join(here, '../test_outputs') 
    2020 
    2121class NAFile4010_TestCase(unittest.TestCase): 
    2222 
    2323    def setUp(self): 
    24         self.infile = os.path.join(base_dir, "data_files", "4010.na") 
    25         self.outfile = os.path.join(base_dir, "test_outputs", "test_4010.na") 
    26         self.out_csv = os.path.join(base_dir, "test_outputs", "test_4010.csv") 
    27         self.out_csv_annotated = os.path.join(base_dir, "test_outputs", "test_4010_annotated.csv") 
     24        self.infile = os.path.join(data_files, "4010.na") 
     25        self.outfile = os.path.join(test_outputs, "test_4010.na") 
     26        self.out_csv = os.path.join(test_outputs, "test_4010.csv") 
     27        self.out_csv_annotated = os.path.join(test_outputs, "test_4010_annotated.csv") 
    2828        self.fin = nappy.openNAFile(self.infile) 
    2929        self.fin.readData() 
Note: See TracChangeset for help on using the changeset viewer.