8
8
9
9
# TODO: @computron - move this test if you also move the loader code -computron
10
10
11
+ module_dir = os .path .dirname (os .path .abspath (__file__ ))
12
+
11
13
12
14
class FuncTest (PymatgenTest ):
13
15
def setUp (self ):
14
16
self .structure = PymatgenTest .get_structure ("Si" )
15
17
16
18
def test_get_wf_from_spec_dict (self ):
17
- d = loadfn (
18
- os .path .join (os .path .abspath (os .path .dirname (__file__ )), "spec.yaml" )
19
- )
19
+ d = loadfn (os .path .join (module_dir , "spec.yaml" ))
20
20
wf = get_wf_from_spec_dict (self .structure , d )
21
21
self .assertEqual (len (wf .fws ), 4 )
22
22
for f in wf .fws :
@@ -25,16 +25,12 @@ def test_get_wf_from_spec_dict(self):
25
25
self .assertEqual (sorted (len (v ) for v in wf .links .values ()), [0 , 0 , 1 , 2 ])
26
26
27
27
self .assertEqual (wf .name , "Si:band structure" )
28
- d = loadfn (
29
- os .path .join (os .path .abspath (os .path .dirname (__file__ )), "badspec.yaml" )
30
- )
28
+ d = loadfn (os .path .join (module_dir , "badspec.yaml" ))
31
29
32
30
self .assertRaises (ImportError , get_wf_from_spec_dict , self .structure , d )
33
31
34
32
def test_multi_parent (self ):
35
- d = loadfn (
36
- os .path .join (os .path .abspath (os .path .dirname (__file__ )), "spec_multi.yaml" )
37
- )
33
+ d = loadfn (os .path .join (module_dir , "spec_multi.yaml" ))
38
34
wf = get_wf_from_spec_dict (self .structure , d )
39
35
self .assertEqual (len (wf .fws ), 3 )
40
36
self .assertEqual (sorted (len (v ) for v in wf .links .values ()), [0 , 1 , 1 ])
0 commit comments