def test3restore_old_config(self): """catalogs.hermes write_hermesConfig restore hermesConfig""" new_config = {'Nights' : '/STER/jorisv/hermesAnalysis', 'CurrentNight' : '/STER/jorisv/hermesAnalysis/BD+34.1543'} old = hermes.write_hermesConfig(filename=self.testfile, **new_config) new = hermes.write_hermesConfig(filename=self.testfile, **old) restored = hermes.write_hermesConfig(filename=self.testfile) msg = 'The new hermesConfig is not correctly restored!' for key in new.keys(): self.assertEqual(restored[key], self.config[key], msg=msg)
def test2correct_update(self): """catalogs.hermes write_hermesConfig update hermesConfig""" new_config = {'Nights' : '/STER/jorisv/hermesAnalysis', 'CurrentNight' : '/STER/jorisv/hermesAnalysis/BD+34.1543'} old = hermes.write_hermesConfig(filename=self.testfile, **new_config) new = hermes.write_hermesConfig(filename=self.testfile) msg = 'The new hermesConfig is not correctly written!' self.config.update(new_config) for key in new.keys(): self.assertEqual(new[key], self.config[key], msg=msg)
def test1no_arguments(self): """catalogs.hermes write_hermesConfig no arguments""" old = hermes.write_hermesConfig(filename=self.testfile) msg = 'write_hermesConfig did not return the correct content of hermesConfig.xml' for key in old.keys(): self.assertEqual(old[key], self.config[key], msg=msg)