Test that when a postgres table is read by the Postgresql cursor, the Table object contains the correct primary keys. This tests interacts with the local PostgreSQL database that's part of the minicluster.
(postgresql_cursor, sql_primary_key_map)
| 170 | 'primary_keys': ('col1', 'col2', 'col3')} |
| 171 | ]) |
| 172 | def test_postgres_table_reading(postgresql_cursor, sql_primary_key_map): |
| 173 | """ |
| 174 | Test that when a postgres table is read by the Postgresql cursor, the Table object |
| 175 | contains the correct primary keys. This tests interacts with the local PostgreSQL |
| 176 | database that's part of the minicluster. |
| 177 | """ |
| 178 | try: |
| 179 | postgresql_cursor.execute('DROP TABLE IF EXISTS mytable') |
| 180 | postgresql_cursor.execute(sql_primary_key_map['sql']) |
| 181 | table = postgresql_cursor.describe_table('mytable') |
| 182 | assert table.primary_key_names == sql_primary_key_map['primary_keys'] |
| 183 | finally: |
| 184 | postgresql_cursor.execute('DROP TABLE mytable') |
nothing calls this directly
no test coverage detected