add test for list parameters

This commit is contained in:
Benedikt Hegner 2016-05-11 00:14:24 +02:00
parent 6e462abb4d
commit 05b6c3f8cf

View File

@ -72,6 +72,10 @@
}
}
# Some Sample repo data
repos_low = [ "/some/path" ]
repos_high = [ "/some/other/path" ]
class ConfigTest(MockPackagesTest):
def setUp(self):
@ -95,6 +99,12 @@ def check_config(self, comps, arch, *compiler_names):
actual = config[arch][key][c]
self.assertEqual(expected, actual)
def test_write_list_in_memory(self):
spack.config.update_config('repos', repos_low, 'test_low_priority')
spack.config.update_config('repos', repos_high, 'test_high_priority')
config = spack.config.get_config('repos')
self.assertEqual(config, repos_high+repos_low)
def test_write_key_in_memory(self):
# Write b_comps "on top of" a_comps.
spack.config.update_config('compilers', a_comps, 'test_low_priority')