File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
PROJECT_ROOT_ENV = 'GAUGE_PROJECT_ROOT'
4
4
STEP_IMPL_DIR_ENV = 'STEP_IMPL_DIR'
5
- STEP_IMPL_DIR_NAMES = os .getenv (STEP_IMPL_DIR_ENV ).split (',' ) if os .getenv (STEP_IMPL_DIR_ENV ) else ['step_impl' ]
6
5
7
6
8
7
def get_project_root ():
@@ -13,6 +12,7 @@ def get_project_root():
13
12
14
13
15
14
def get_step_impl_dirs ():
15
+ STEP_IMPL_DIR_NAMES = map (str .strip , os .getenv (STEP_IMPL_DIR_ENV ).split (',' )) if os .getenv (STEP_IMPL_DIR_ENV ) else ['step_impl' ]
16
16
return [os .path .join (get_project_root (), name ) for name in STEP_IMPL_DIR_NAMES ]
17
17
18
18
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ def load_implementations():
32
32
for impl_dir in d :
33
33
if not path .exists (impl_dir ):
34
34
logging .error ('can not load implementations from {}. {} does not exist.' .format (impl_dir , impl_dir ))
35
- return
36
35
load_files (d )
37
36
38
37
Original file line number Diff line number Diff line change 1
1
from unittest import main , TestCase
2
+ from getgauge .util import get_step_impl_dirs
2
3
import os
3
4
4
5
5
6
class UtilTests (TestCase ):
6
7
8
+ def test_get_step_impl_gives_default_if_no_env_Set (self ):
9
+ dirs = get_step_impl_dirs ()
10
+ expected = ['step_impl' ]
11
+ self .assertEquals (dirs ,expected )
12
+
7
13
def test_get_step_impl_returns_array_of_impl_dirs (self ):
8
- os .environ ["STEP_IMPL_DIR" ] = "step_impl,step_impl1"
9
- from getgauge .util import get_step_impl_dirs
14
+ os .environ ["STEP_IMPL_DIR" ] = "step_impl, step_impl1"
10
15
dirs = get_step_impl_dirs ()
11
16
expected = ['step_impl' ,'step_impl1' ]
12
17
self .assertEquals (dirs ,expected )
You can’t perform that action at this time.
0 commit comments