Line | |
---|
1 | """Automatic verification that the ANUGA code validates against the example |
---|
2 | devised by Joquim Luis. See README.txt for more details. |
---|
3 | """ |
---|
4 | |
---|
5 | import unittest |
---|
6 | import os |
---|
7 | |
---|
8 | class Test_Pixel(unittest.TestCase): |
---|
9 | def setUp(self): |
---|
10 | |
---|
11 | # Remove garbage |
---|
12 | for file in os.listdir('.'): |
---|
13 | |
---|
14 | # Don't remove br_swan.sww |
---|
15 | if file == 'br_swan.sww': continue |
---|
16 | |
---|
17 | if file.endswith('.stdout') or\ |
---|
18 | file.endswith('.dem') or\ |
---|
19 | file.endswith('.pts') or\ |
---|
20 | file.endswith('.sww') or\ |
---|
21 | file.endswith('.msh') or\ |
---|
22 | file.endswith('~'): |
---|
23 | os.remove(file) |
---|
24 | |
---|
25 | |
---|
26 | def tearDown(self): |
---|
27 | pass |
---|
28 | |
---|
29 | def test_that_script_can_run_without_errors(self): |
---|
30 | |
---|
31 | s = 'run_pixel_registration.py' |
---|
32 | res = os.system('python %s > run_pixel_registration.stdout' %s) |
---|
33 | assert res == 0 |
---|
34 | |
---|
35 | |
---|
36 | |
---|
37 | #------------------------------------------------------------- |
---|
38 | if __name__ == "__main__": |
---|
39 | suite = unittest.makeSuite(Test_Pixel, 'test') |
---|
40 | runner = unittest.TextTestRunner(verbosity=2) |
---|
41 | runner.run(suite) |
---|
Note: See
TracBrowser
for help on using the repository browser.