Skip to content

Commit

Permalink
test: Add a test for schemas of jsonb objects. (#170)
Browse files Browse the repository at this point in the history
Checks that the schema for a `jsonb` column in postgres is represented
by `object` in jsonschema.
  • Loading branch information
sebastianswms authored Jul 12, 2023
1 parent 6a465c6 commit 93673f2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ def test_jsonb():
tap_class=TapPostgres, config=SAMPLE_CONFIG, catalog=tap_catalog
)
test_runner.sync_all()
for schema_message in test_runner.schema_messages:
if (
"stream" in schema_message
and schema_message["stream"] == altered_table_name
):
assert "object" in schema_message["schema"]["properties"]["column"]["type"]
assert test_runner.records[altered_table_name][0] == {"column": {"foo": "bar"}}


Expand Down

0 comments on commit 93673f2

Please sign in to comment.