Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
 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)