Issue fixed comparison asserting incorrect config file backed up
in tests
@@ -84,10 +84,10 @@ class NiftyNetGlobalConfigTest(TestCase):
def test_012_incorrect_config_file_backed_up(self):
# create an incorrect config file at the correct location
makedirs(NiftyNetGlobalConfigTest.config_home)
- incorrect_config = 'invalid_home_tag = ~/niftynet'
+ incorrect_config = '\n'.join([NiftyNetGlobalConfigTest.header,
+ 'invalid_home_tag = ~/niftynet'])
with open(NiftyNetGlobalConfigTest.config_file, 'w') as config_file:
- config_file.write('\n'.join(
- [NiftyNetGlobalConfigTest.header, incorrect_config]))
+ config_file.write(incorrect_config)
# the following should back it up and replace it with default config
global_config = NiftyNetGlobalConfig()
