def test_getSnapshotPath(self): tm = TMSaveCache({}, conf_filename=self.conf_filename) tm._getRemoteFileContent = Mock(return_value="""[default] volume_name = /foo/bar """) tm.diskName = 'baz' assert '/foo/bar/baz' == tm._getSnapshotPath()
def test_getSnapshotPathConfParamNotInFile(self): tm = TMSaveCache({}, conf_filename=self.conf_filename) tm._getRemoteFileContent = Mock(return_value="""[default] foo = bar """) self.failUnlessRaises(ConfigurationException, tm._getSnapshotPath)