Issue global config tests now write a [global] header as well
@@ -35,6 +35,7 @@ class NiftyNetGlobalConfigTest(TestCase):
cls.file_type = 'ini'
cls.config_file = join(cls.config_home, cls.typify('config'))
+ cls.header = '[global]'
cls.default_config_opts = {
'home': '~/niftynet'
}
@@ -73,6 +74,7 @@ class NiftyNetGlobalConfigTest(TestCase):
custom_niftynet_home_abs = expanduser(custom_niftynet_home)
config = ''.join(['home = ', custom_niftynet_home])
with open(NiftyNetGlobalConfigTest.config_file, 'w') as config_file:
+ config_file.write(NiftyNetGlobalConfigTest.header)
config_file.write(config)
global_config = NiftyNetGlobalConfig()
@@ -84,6 +86,7 @@ class NiftyNetGlobalConfigTest(TestCase):
makedirs(NiftyNetGlobalConfigTest.config_home)
incorrect_config = 'invalid_home_tag = ~/niftynet'
with open(NiftyNetGlobalConfigTest.config_file, 'w') as config_file:
+ config_file.write(NiftyNetGlobalConfigTest.header)
config_file.write(incorrect_config)
# the following should back it up and replace it with default config
