diff --git a/easybuild/test/easyconfig.py b/easybuild/test/easyconfig.py index bc05c5c6e5..8feaaf1ada 100644 --- a/easybuild/test/easyconfig.py +++ b/easybuild/test/easyconfig.py @@ -478,7 +478,7 @@ def runTest(self): self.assertEqual(ec['toolchain'], {'name': tcname, 'version': tcver}) # can't check for key 'foo', because EasyConfig ignores parameter names it doesn't know about txt = open(res[1], "r").read() - self.assertTrue(re.search("foo = '%s'" % specs['foo'], txt)) + self.assertTrue(re.search('foo = "%s"' % specs['foo'], txt)) os.remove(res[1]) # should pick correct version, i.e. not newer than what's specified, if a choice needs to be made diff --git a/easybuild/test/modulegenerator.py b/easybuild/test/modulegenerator.py index 11993c7030..8f9feb77e4 100644 --- a/easybuild/test/modulegenerator.py +++ b/easybuild/test/modulegenerator.py @@ -77,7 +77,7 @@ def runTest(self): desc = self.modgen.get_description() self.assertEqual(desc, expected) - # test loadModule + # test load_module expected = """ if { ![is-loaded name/version] } { module load name/version @@ -85,7 +85,7 @@ def runTest(self): """ self.assertEqual(expected, self.modgen.load_module("name", "version")) - # test unloadModule + # test unload_module expected = """ if { ![is-loaded name/version] } { if { [is-loaded name] } { @@ -95,7 +95,7 @@ def runTest(self): """ self.assertEqual(expected, self.modgen.unload_module("name", "version")) - # test prependPaths + # test prepend_paths expected = """prepend-path key $root/path1 prepend-path key $root/path2 """ @@ -110,8 +110,11 @@ def runTest(self): self.modgen.prepend_paths, "key2", ["bar", "/tmp/foo"]) - # test setEnvironment - self.assertEqual("setenv\tkey\t\tvalue\n", self.modgen.set_environment("key", "value")) + # test set_environment + self.assertEqual('setenv\tkey\t\t"value"\n', self.modgen.set_environment("key", "value")) + self.assertEqual("setenv\tkey\t\t'va\"lue'\n", self.modgen.set_environment("key", 'va"lue')) + self.assertEqual('setenv\tkey\t\t"va\'lue"\n', self.modgen.set_environment("key", "va'lue")) + self.assertEqual('setenv\tkey\t\t"""va"l\'ue"""\n', self.modgen.set_environment("key", """va"l'ue""")) def tearDown(self): """cleanup"""