def testSaveLoad(self): file = os.path.join(testEupsStack, "ups_db", "test.tags") if os.path.exists(file): os.remove(file) self.assert_(not os.path.exists(file)) try: self.tags.registerTag("current") self.tags.registerTag("beta") self.tags.save(self.tags.global_, file) self.assert_(os.path.exists(file)) tags = Tags() tags.load(tags.global_, file) names = tags.getTagNames() self.assertEquals(len(names), 3) for tag in "stable current beta".split(): self.assertIn(tag, names, tag+" not found amoung loaded names") finally: if os.path.exists(file): os.remove(file)
def testSaveLoad(self): file = os.path.join(testEupsStack, "ups_db", "test.tags") if os.path.exists(file): os.remove(file) self.assert_(not os.path.exists(file)) try: self.tags.registerTag("current") self.tags.registerTag("beta") self.tags.save(self.tags.global_, file) self.assert_(os.path.exists(file)) tags = Tags() tags.load(tags.global_, file) names = tags.getTagNames() self.assertEqual(len(names), 3) for tag in "stable current beta".split(): self.assertIn(tag, names, tag + " not found amoung loaded names") finally: if os.path.exists(file): os.remove(file)