Changeset 984 for trunk


Ignore:
Timestamp:
Apr 22, 2019, 5:38:23 PM (3 months ago)
Author:
cito
Message:

Test existence of all query methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/test_classic_connection.py

    r980 r984  
    122122
    123123    def testAllConnectMethods(self):
    124         methods = '''cancel close date_format describe_prepared endcopy
     124        methods = '''
     125            cancel close date_format describe_prepared endcopy
    125126            escape_bytea escape_identifier escape_literal escape_string
    126127            fileno get_cast_hook get_notice_receiver getline getlo getnotify
    127128            inserttable locreate loimport parameter
    128129            prepare putline query query_prepared reset
    129             set_cast_hook set_notice_receiver source transaction'''.split()
     130            set_cast_hook set_notice_receiver source transaction
     131            '''.split()
    130132        connection_methods = [a for a in dir(self.connection)
    131133            if not a.startswith('__') and self.is_method(a)]
     
    188190    def testMethodQueryEmpty(self):
    189191        self.assertRaises(ValueError, self.connection.query, '')
     192
     193    def testAllQueryMembers(self):
     194        query = self.connection.query("select true where false")
     195        members = '''
     196            dictiter dictresult fieldname fieldnum getresult listfields
     197            namediter namedresult ntuples one onedict onenamed onescalar
     198            scalariter scalarresult single singledict singlenamed singlescalar
     199            '''.split()
     200        query_members = [a for a in dir(query)
     201            if not a.startswith('__')]
     202        self.assertEqual(members, query_members)
    190203
    191204    def testMethodEndcopy(self):
Note: See TracChangeset for help on using the changeset viewer.