@@ -22,12 +22,18 @@ class NAFile2160_TestCase(unittest.TestCase):
22
22
23
23
def setUp (self ):
24
24
self .infile = os .path .join (data_files , "2160.na" )
25
+ self .ndacc_infile = os .path .join (data_files , "2160_ndacc.na" )
25
26
self .outfile = os .path .join (test_outputs , "test_2160.na" )
27
+ self .ndacc_outfile = os .path .join (test_outputs , "test_2160_ndacc.na" )
26
28
self .out_csv = os .path .join (test_outputs , "test_2160.csv" )
27
29
self .out_csv_annotated = os .path .join (test_outputs , "test_2160_annotated.csv" )
28
30
self .fin = nappy .openNAFile (self .infile )
29
31
self .fin .readData ()
30
- self .na_dict = self .fin .getNADict ()
32
+ self .na_dict = self .fin .getNADict ()
33
+
34
+ self .ndacc_fin = nappy .openNAFile (self .ndacc_infile , ignore_header_lines = 1 )
35
+ self .ndacc_fin .readData ()
36
+ self .ndacc_na_dict = self .ndacc_fin .getNADict ()
31
37
32
38
def test_read2160 (self ):
33
39
"Tests reading FFI 2160."
@@ -38,6 +44,12 @@ def test_write2160(self):
38
44
fobj = nappy .openNAFile (self .outfile , mode = "w" , na_dict = self .na_dict )
39
45
fobj .write ()
40
46
self .failUnless (isinstance (fobj , nappy .na_file .na_file .NAFile ))
47
+
48
+ def test_write_ndacc (self ):
49
+ "Tests writing FFI 2160 NDACC format."
50
+ fobj = nappy .openNAFile (self .ndacc_outfile , mode = "w" , na_dict = self .ndacc_na_dict )
51
+ fobj .write ()
52
+ self .failUnless (isinstance (fobj , nappy .na_file .na_file .NAFile ))
41
53
42
54
def test_writeCSV2160 (self ):
43
55
"Tests conversion to CSV."
0 commit comments