def testProperties3(self): c = HTTPError("http://localhost/", self.code, self.msg, None, None) e = dalq.DALServiceError(self.msg, self.code, c) self.assertEquals(self.msg, e.reason) self.assert_(e.cause is c) self.assertEquals(self.code, e.code) self.assert_(e.url is None)
def testProperties4(self): c = HTTPError("http://localhost/", self.code, self.msg, None, None) e = dalq.DALServiceError(self.msg, self.code, c, self.url) self.assertEquals(self.msg, e.reason) self.assert_(e.cause is c) self.assertEquals(self.code, e.code) self.assertEquals(self.url, e.url) del e.cause self.assert_(e.cause is None) e.cause = c self.assert_(e.cause is c) e.code = 505 self.assertEquals(505, e.code) del e.code self.assert_(e.code is None)
def testPropertiesDef(self): e = dalq.DALServiceError() self.assert_(e.reason and e.reason.startswith("Unknown service ")) self.assert_(e.cause is None) self.assert_(e.code is None) self.assert_(e.url is None)
def testProperties1(self): e = dalq.DALServiceError(self.msg) self.assertEquals(self.msg, e.reason) self.assert_(e.cause is None) self.assert_(e.code is None) self.assert_(e.url is None)