def testWrite(self): self.cf.setVersion("2.0", "Linux:rhel") self.assertEquals(len(self.cf.getFlavors()), 2) file = os.path.join(testEupsStack, "tst.current") self.cf.write(file) cf = ChainFile(file) self.assertEquals(cf.name, "fw") self.assertEquals(cf.tag, "current") flavors = cf.getFlavors() self.assertEquals(len(flavors), 2) self.assert_("DarwinX86" in flavors) flavor = cf.info["DarwinX86"] self.assertEquals(flavor['declarer'], 'rhl') self.assertEquals(flavor['modifier'], 'rhl') self.assertEquals(flavor['version'], 'svn3941') self.assertEquals(flavor['modified'], 'Thu Jan 24 23:43:35 2008') self.assertEquals(flavor['declared'], 'Thu Jan 24 23:43:35 2008') self.assert_("Linux:rhel" in flavors)
def testParsing(self): self.assertEquals(self.cf.name, "fw") self.assertEquals(self.cf.tag, "current") flavors = self.cf.getFlavors() self.assertEquals(len(flavors), 1) self.assert_("DarwinX86" in flavors) flavor = self.cf.info["DarwinX86"] self.assertEquals(flavor['declarer'], 'rhl') self.assertEquals(flavor['modifier'], 'rhl') self.assertEquals(flavor['version'], 'svn3941') self.assertEquals(flavor['modified'], 'Thu Jan 24 23:43:35 2008') self.assertEquals(flavor['declared'], 'Thu Jan 24 23:43:35 2008') self.assertEquals(self.cf.getVersion("DarwinX86"), "svn3941") self.cf = ChainFile(os.path.join(testEupsStack, "fw.current"), "afw", "stable", verbosity=-1) self.assertEquals(self.cf.name, "afw") self.assertEquals(self.cf.tag, "stable") flavors = self.cf.getFlavors() self.assertEquals(len(flavors), 1)
def setUp(self): self.cf = ChainFile(os.path.join(testEupsStack, "fw.current"))