source: nappy/trunk/tests/make_na_file_unit_tests.py @ 3625

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/nappy/trunk/tests/make_na_file_unit_tests.py@7710
Revision 3625, 814 bytes checked in by astephen, 12 years ago (diff)

Cleaned up some of the data files and improved unit tests and comparison code.

Line 
1#!/usr/bin/env python
2
3"""
4make_na_file_unit_tests.py
5==========================
6
7Simple script for making basic unit tests for each of the NAFile classes.
8
9"""
10
11# Import standard library modules
12import sys
13import glob
14import os
15
16
17def makeNAFileTests():
18    "Makes unit tests for the main NAFile classes."
19    ffis = ("1001", "1010", "1020", "2010", "2110", "2160",
20            "2310", "3010", "4010")
21
22    template = open("test_na_file_template.tmpl").read()
23
24    for ffi in ffis:
25        content = template.replace("<FFI>", ffi)
26        test_file_name = "test_na_file_%s.py" % ffi
27        test_file = open(test_file_name, "w")
28        test_file.write(content)
29        test_file.close()
30        print "Wrote:", test_file_name
31
32
33if __name__ == "__main__":
34
35    makeNAFileTests()
Note: See TracBrowser for help on using the repository browser.