def test_add_field(self): self.create_table() field = {'name': 'counter', 'type': 'INTEGER'} pga.add_field(self.tablename, field) schema = pga.get_schema(self.tablename) self.assertEqual(schema[2]['name'], 'counter') self.assertEqual(schema[2]['type'], 'INTEGER')
def test_cant_add_existing_field(self): self.create_table() field = { 'name': 'name', 'type': 'TEXT' } with self.assertRaises(OperationalError): pga.add_field(self.tablename, field)
def test_add_field(self): self.create_table() field = { 'name': 'counter', 'type': 'INTEGER' } pga.add_field(self.tablename, field) schema = pga.get_schema(self.tablename) self.assertEqual(schema[2]['name'], 'counter') self.assertEqual(schema[2]['type'], 'INTEGER')
def test_cant_add_existing_field(self): self.create_table() field = {'name': 'name', 'type': 'TEXT'} with self.assertRaises(OperationalError): pga.add_field(self.tablename, field)