Fixed inet test that wasn't testing anything

This commit is contained in:
Daniele Varrazzo 2012-02-23 23:35:05 +00:00
parent 98d6d96ee3
commit 9ffa1f4b59

View File

@ -82,9 +82,9 @@ class TypesExtrasTests(unittest.TestCase):
def testINET(self): def testINET(self):
psycopg2.extras.register_inet() psycopg2.extras.register_inet()
i = "192.168.1.0/24"; i = psycopg2.extras.Inet("192.168.1.0/24")
s = self.execute("SELECT %s AS foo", (i,)) s = self.execute("SELECT %s AS foo", (i,))
self.failUnless(i == s) self.failUnless(i.addr == s.addr)
# must survive NULL cast to inet # must survive NULL cast to inet
s = self.execute("SELECT NULL::inet AS foo") s = self.execute("SELECT NULL::inet AS foo")
self.failUnless(s is None) self.failUnless(s is None)