forked from canonical/postgresql-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add libpq connection string (canonical#527)
- Loading branch information
1 parent
eef3555
commit dd72f65
Showing
2 changed files
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,7 @@ def request_database(_harness): | |
_harness.update_relation_data( | ||
rel_id, | ||
_harness.charm.app.name, | ||
{"data": "", "username": "", "password": "", "version": "", "database": ""}, | ||
{"data": "", "username": "", "password": "", "uris": "", "version": "", "database": ""}, | ||
) | ||
|
||
# Simulate the request of a new database plus extra user roles. | ||
|
@@ -94,10 +94,11 @@ def test_on_database_requested(harness): | |
_member_started.side_effect = [False, True, True, True, True, True] | ||
_primary_endpoint.side_effect = [ | ||
None, | ||
{"1.1.1.1"}, | ||
{"1.1.1.1"}, | ||
{"1.1.1.1"}, | ||
{"1.1.1.1"}, | ||
"1.1.1.1", | ||
"1.1.1.1", | ||
"1.1.1.1", | ||
"1.1.1.1", | ||
"1.1.1.1", | ||
] | ||
postgresql_mock.create_user = PropertyMock( | ||
side_effect=[None, PostgreSQLCreateUserError, None, None] | ||
|
@@ -141,6 +142,7 @@ def test_on_database_requested(harness): | |
"data": f'{{"database": "{DATABASE}", "extra-user-roles": "{EXTRA_USER_ROLES}"}}', | ||
"username": user, | ||
"password": "test-password", | ||
"uris": f"postgresql://{user}:[email protected]:5432/{DATABASE}", | ||
"version": POSTGRESQL_VERSION, | ||
"database": f"{DATABASE}", | ||
} | ||
|