Пример #1
0
    def testAutoSave(self):
        self.assert_(self.stack.saveNeeded())

        cache = os.path.join(os.environ["PWD"],
                             ProductStack.persistFilename("Darwin"))
        if os.path.exists(cache):  os.remove(cache)

        stack = ProductStack(os.path.join(testEupsStack, "ups_db"), 
                             os.environ["PWD"], autosave=True)
        self.assert_(not stack.saveNeeded())
        stack.addProduct(Product("fw", "1.2", "Darwin", 
                                 "/opt/sw/Darwin/fw/1.2", "none"))
        self.assert_(not stack.saveNeeded())
        self.assert_(os.path.exists(cache))
        if os.path.exists(cache):  os.remove(cache)
Пример #2
0
 def setUp(self):
     self.dbpath = os.path.join(testEupsStack, "ups_db")
     self.stack = ProductStack(self.dbpath, autosave=False)
     self.stack.addProduct(Product("fw", "1.2", "Darwin", 
                                   "/opt/sw/Darwin/fw/1.2", "none"))