def test_datatore_tuple(self): conn = DataStoreFactory('pg:chula@localhost/chula_test', 'chula') cursor = conn.cursor(type='tuple') try: cursor.execute('SELECT * FROM cars LIMIT 1;') values = cursor.fetchone() self.assertEquals(values, (1, 'Honda', 'Civic')) finally: conn.rollback() conn.close()
def test_datatore_basic(self): conn = DataStoreFactory('pg:chula@localhost/chula_test', 'chula') cursor = conn.cursor() try: cursor.execute('SELECT * FROM cars LIMIT 1;') keys = cursor.fetchone().keys() keys.sort() self.assertEquals(keys, ['make', 'model', 'uid']) finally: conn.rollback() conn.close()