MCPcopy
hub / github.com/psycopg/psycopg / test_None

Method test_None

tests/dbapi20.py:804–816  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

802 raise NotImplementedError('Driver needed to override this test')
803
804 def test_None(self):
805 con = self._connect()
806 try:
807 cur = con.cursor()
808 self.executeDDL1(cur)
809 cur.execute('insert into %sbooze values (NULL)' % self.table_prefix)
810 cur.execute('select name from %sbooze' % self.table_prefix)
811 r = cur.fetchall()
812 self.assertEqual(len(r),1)
813 self.assertEqual(len(r[0]),1)
814 self.assertEqual(r[0][0],None,'NULL value not returned as None')
815 finally:
816 con.close()
817
818 def test_Date(self):
819 d1 = self.driver.Date(2002,12,25)

Callers

nothing calls this directly

Calls 6

_connectMethod · 0.95
executeDDL1Method · 0.95
cursorMethod · 0.45
executeMethod · 0.45
fetchallMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected