Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/nappy/trunk/nappy/unit_tests/test_na_file_1001.py@3349
Revision 3349,
1.1 KB
checked in by astephen, 13 years ago
(diff) |
Tidied some variable names and boolean types.
|
Line | |
---|
1 | """ |
---|
2 | test_na_file_1001.py |
---|
3 | ==================== |
---|
4 | |
---|
5 | Tests for the na_file_1001.py module. |
---|
6 | |
---|
7 | """ |
---|
8 | |
---|
9 | # Import standard library modules |
---|
10 | import unittest |
---|
11 | import os |
---|
12 | import sys |
---|
13 | |
---|
14 | # Import local modules |
---|
15 | os.environ["NAPPY_BASE_DIR"] = "..\\.." |
---|
16 | base_dir = os.environ["NAPPY_BASE_DIR"] |
---|
17 | sys.path.append(base_dir) |
---|
18 | |
---|
19 | import nappy |
---|
20 | import nappy.na_file.na_file |
---|
21 | |
---|
22 | class NAFile1001_TestCase(unittest.TestCase): |
---|
23 | |
---|
24 | def setUp(self): |
---|
25 | self.infile = os.path.join(base_dir, "data_files", "1001.na") |
---|
26 | self.outfile = os.path.join(base_dir, "test_outputs", "test_1001.na") |
---|
27 | self.fin = nappy.openNAFile(self.infile) |
---|
28 | self.fin.readData() |
---|
29 | self.na_dict = self.fin.getNADict() |
---|
30 | |
---|
31 | def test_read1001(self): |
---|
32 | "Tests reading FFI 1001." |
---|
33 | self.assertEqual(type(self.na_dict), type({1:2})) |
---|
34 | |
---|
35 | def test_write1001(self): |
---|
36 | "Tests writing FFI 1001." |
---|
37 | self.fobj = nappy.openNAFile(self.outfile, mode="w", na_dict=self.na_dict) |
---|
38 | self.failUnless(isinstance(self.fobj, nappy.na_file.na_file.NAFile)) |
---|
39 | |
---|
40 | if __name__ == "__main__": |
---|
41 | |
---|
42 | unittest.main() |
---|
43 | |
---|
Note: See
TracBrowser
for help on using the repository browser.