Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reinstate optional '(default)' suffix for 'module avail' #724

Merged
merged 3 commits into from Oct 16, 2013
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions easybuild/tools/modules.py
Expand Up @@ -71,9 +71,8 @@
'error': re.compile(r"^\S+:(?P<level>\w+):(?P<code>(?!57|64)\d+):\s+(?P<msg>.*)$"),
# available with --terse has one module per line
# matches modules such as "ictce/3.2.1.015.u4"
# line ending with : is ignored (the modulepath in --terse)
# FIXME: --terse ignores defaultness
'available': re.compile(r"^\s*(?P<mod_name>[^\(\s:]+)\s*[^:\S]*$")
# lines ending are ':' is ignored (the modulepath in --terse)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean here?

'available': re.compile(r"^\s*(?P<mod_name>[^\(\s:]+)(?P<default>\(default\))?\s*[^:\S]*$"),
}

_log = fancylogger.getLogger('modules', fname=False)
Expand Down
6 changes: 4 additions & 2 deletions test/framework/modules.py
Expand Up @@ -57,8 +57,6 @@ def setUp(self):
def test_avail(self):
"""Test if getting a (restricted) list of available modules works."""
testmods = modules_tool([os.path.join(os.path.dirname(__file__), 'modules')])
ms = testmods.available()
self.assertEqual(len(ms), TEST_MODULES_COUNT)

# test modules include 3 GCC modules
ms = testmods.available('GCC')
Expand All @@ -68,6 +66,10 @@ def test_avail(self):
ms = testmods.available(mod_name='GCC/4.6.3')
self.assertEqual(ms, ['GCC/4.6.3'])

# all test modules are accounted for
ms = testmods.available()
self.assertEqual(len(ms), TEST_MODULES_COUNT)

def test_exists(self):
"""Test if testing for module existence works."""
testmods = modules_tool([os.path.join(os.path.dirname(__file__), 'modules')])
Expand Down
2 changes: 2 additions & 0 deletions test/framework/modules/GCC/.modulerc
@@ -0,0 +1,2 @@
#%Module1.0
module-version GCC/4.6.4 default