Exemplo n.º 1
0
    def testRetrieveInstanceId(self):
        tm = TMSaveCache({},
            conf_filename=self.conf_filename)

        for path in ['foo', '/a/b', '/1/2']:
            tm.diskSrcPath = path
            self.failUnlessRaises(ValueError, tm._retrieveInstanceId)

        for path in ['/a/1', '/a/1/b']:
            tm.diskSrcPath = path
            tm._retrieveInstanceId()
            self.failUnlessEqual(tm.instanceId, 1)