-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
36 lines (25 loc) · 1.02 KB
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from nose.tools import assert_raises, assert_equal
import strahl
def test_sanity_check():
p = strahl.default_params()
strahl.sanity_check(p) # this should go fine
p.pop('shot') # remove a parameter
assert_raises(AssertionError, strahl.sanity_check, p)
from strahl.input_datablocks import plasma_background, geometry, \
main_parameter_file
def test_datablocks():
p = strahl.default_params()
plasma_background(p)
geometry(p)
main_parameter_file(p)
from strahl.input import input_directory_names, input_file_names
def test_create_input():
o = input_directory_names('xxx')
assert_equal(o['nete'], 'xxx/nete')
assert_equal(o['param_files'], 'xxx/param_files')
assert_equal(o['results'], 'xxx/results')
o = input_file_names('xxx', strahl.default_params())
assert_equal(o['geometry'], 'xxx/nete/grid_99999.0')
assert_equal(o['background'], 'xxx/nete/pp99999.0')
assert_equal(o['main'], 'xxx/param_files/main_99999.0')
assert_equal(o['influx'], 'xxx/nete/Arflx99999.dat')