Skip to content

Commit 7e9c7d1

Browse files
committed
update test_make_module_req to be compatible with refactor of make_module_req
1 parent 93fc7a9 commit 7e9c7d1

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

test/framework/easyblock.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,13 @@ def test_make_module_req(self):
433433

434434
# create fake directories and files that should be guessed
435435
os.makedirs(eb.installdir)
436-
write_file(os.path.join(eb.installdir, 'foo.jar'), 'foo.jar')
437-
write_file(os.path.join(eb.installdir, 'bla.jar'), 'bla.jar')
438436
for path in ('bin', ('bin', 'testdir'), 'sbin', 'share', ('share', 'man'), 'lib', 'lib64'):
439437
if isinstance(path, str):
440438
path = (path, )
441439
os.mkdir(os.path.join(eb.installdir, *path))
440+
write_file(os.path.join(eb.installdir, 'foo.jar'), 'foo.jar')
441+
write_file(os.path.join(eb.installdir, 'bla.jar'), 'bla.jar')
442+
write_file(os.path.join(eb.installdir, 'share', 'man', 'pi'), 'Man page')
442443
# this is not a path that should be picked up
443444
os.mkdir(os.path.join(eb.installdir, 'CPATH'))
444445

@@ -519,7 +520,7 @@ def test_make_module_req(self):
519520
guess, re.M)), 1)
520521

521522
# check for behavior when a string value is used as dict value by make_module_req_guesses
522-
eb.make_module_req_guess = lambda: {'PATH': 'bin'}
523+
eb.make_module_req_guess = lambda: {'PATH': (['bin'], False)}
523524
with eb.module_generator.start_module_creation():
524525
txt = eb.make_module_req()
525526
if get_module_syntax() == 'Tcl':
@@ -531,7 +532,7 @@ def test_make_module_req(self):
531532

532533
# check for correct behaviour if empty string is specified as one of the values
533534
# prepend-path statements should be included for both the 'bin' subdir and the install root
534-
eb.make_module_req_guess = lambda: {'PATH': ['bin', '']}
535+
eb.make_module_req_guess = lambda: {'PATH': (['bin', ''], False)}
535536
with eb.module_generator.start_module_creation():
536537
txt = eb.make_module_req()
537538
if get_module_syntax() == 'Tcl':
@@ -544,7 +545,9 @@ def test_make_module_req(self):
544545
self.fail("Unknown module syntax: %s" % get_module_syntax())
545546

546547
# check for correct order of prepend statements when providing a list (and that no duplicates are allowed)
547-
eb.make_module_req_guess = lambda: {'LD_LIBRARY_PATH': ['lib/pathC', 'lib/pathA', 'lib/pathB', 'lib/pathA']}
548+
eb.make_module_req_guess = lambda: {
549+
'LD_LIBRARY_PATH': (['lib/pathC', 'lib/pathA', 'lib/pathB', 'lib/pathA'], False),
550+
}
548551
for path in ['pathA', 'pathB', 'pathC']:
549552
os.mkdir(os.path.join(eb.installdir, 'lib', path))
550553
write_file(os.path.join(eb.installdir, 'lib', path, 'libfoo.so'), 'test')
@@ -572,7 +575,7 @@ def test_make_module_req(self):
572575
# If PATH or LD_LIBRARY_PATH contain only folders, do not add an entry
573576
sub_lib_path = os.path.join('lib', 'path_folders')
574577
sub_path_path = os.path.join('bin', 'path_folders')
575-
eb.make_module_req_guess = lambda: {'LD_LIBRARY_PATH': sub_lib_path, 'PATH': sub_path_path}
578+
eb.make_module_req_guess = lambda: {'LD_LIBRARY_PATH': (sub_lib_path, False), 'PATH': (sub_path_path, False)}
576579
for path in (sub_lib_path, sub_path_path):
577580
full_path = os.path.join(eb.installdir, path, 'subpath')
578581
os.makedirs(full_path)

0 commit comments

Comments
 (0)