Пример #1
0
 def test_can_create_table(self):
     fields = [
         {'name': 'id', 'type': 'INTEGER', 'indexed': True},
         {'name': 'name', 'type': 'TEXT'}
     ]
     pga.create_table('testing', fields)
     sql.db_insert(TEST_PGA_PATH, 'testing', {'name': "testok"})
     results = sql.db_select(TEST_PGA_PATH, 'testing',
                             fields=['id', 'name'])
     self.assertEqual(results[0]['name'], "testok")
Пример #2
0
 def test_cant_create_empty_table(self):
     with self.assertRaises(OperationalError):
         pga.create_table('emptytable', [])
Пример #3
0
 def create_table(self):
     pga.create_table(self.tablename, self.schema)