Skip to content

Commit

Permalink
Compare the version to the one returned in the Server header
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenceisla committed Jul 3, 2023
1 parent 701e687 commit 1e006e4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/io/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,10 @@ def test_get_pgrst_version_with_uri_connection_string(dburi_type, dburi, default

with run(env=env[dburi_type]) as postgrest:
response = postgrest.session.post("/rpc/get_pgrst_version")
assert response.text.startswith('"PostgREST ')
version = '"%s"' % response.headers["Server"].replace(
"postgrest/", "PostgREST "
)
assert response.text == version


def test_get_pgrst_version_with_keyval_connection_string(defaultenv):
Expand All @@ -1032,4 +1035,7 @@ def test_get_pgrst_version_with_keyval_connection_string(defaultenv):

with run(env=env) as postgrest:
response = postgrest.session.post("/rpc/get_pgrst_version")
assert response.text.startswith('"PostgREST ')
version = '"%s"' % response.headers["Server"].replace(
"postgrest/", "PostgREST "
)
assert response.text == version

0 comments on commit 1e006e4

Please sign in to comment.