code: def test_with_ok(self):
      with self.conn as conn:
          with conn.cursor() as curs:
              curs.execute("insert into test_with values (4)")
              self.assert_(not curs.closed)
          self.assertEqual(self.conn.status, ext.STATUS_BEGIN)
          self.assert_(curs.closed)
  
      self.assertEqual(self.conn.status, ext.STATUS_READY)
      self.assert_(not self.conn.closed)
  
      curs = self.conn.cursor()
      curs.execute("select * from test_with")
      self.assertEqual(curs.fetchall(), [(4,)])
  
imports: import psycopg2
  import psycopg2.extensions
  import unittest
  from .testutils import ConnectingTestCase, skip_before_postgres, skip_if_crdb
label_desc: Use image node_id 1 for calling the WithCursorTestCase obj's underlying member method code with example usage: obj.test_with_ok() without return types