-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MISC] Merge update_tls_flag into update_endpoints (#669)
* Merge update_tls_flag into update_endpoints * No peer data
- Loading branch information
Showing
3 changed files
with
18 additions
and
29 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
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 |
---|---|---|
|
@@ -142,7 +142,6 @@ def test_on_database_requested(harness): | |
"password": "test-password", | ||
"version": POSTGRESQL_VERSION, | ||
"database": f"{DATABASE}", | ||
"tls": "False", | ||
} | ||
|
||
# Assert no BlockedStatus was set. | ||
|
@@ -154,7 +153,6 @@ def test_on_database_requested(harness): | |
# No data is set in the databag by the database. | ||
assert harness.get_relation_data(rel_id, harness.charm.app.name) == { | ||
"data": f'{{"database": "{DATABASE}", "extra-user-roles": "{EXTRA_USER_ROLES}"}}', | ||
"tls": "False", | ||
} | ||
|
||
# BlockedStatus due to a PostgreSQLCreateDatabaseError. | ||
|
@@ -163,7 +161,6 @@ def test_on_database_requested(harness): | |
# No data is set in the databag by the database. | ||
assert harness.get_relation_data(rel_id, harness.charm.app.name) == { | ||
"data": f'{{"database": "{DATABASE}", "extra-user-roles": "{EXTRA_USER_ROLES}"}}', | ||
"tls": "False", | ||
} | ||
|
||
# BlockedStatus due to a PostgreSQLGetPostgreSQLVersionError. | ||
|
@@ -256,6 +253,7 @@ def test_update_endpoints_with_event(harness): | |
"endpoints": "1.1.1.1:5432", | ||
"read-only-endpoints": "2.2.2.2:5432", | ||
"uris": "postgresql://relation-2:[email protected]:5432/test_db", | ||
"tls": "False", | ||
} | ||
assert harness.get_relation_data(another_rel_id, harness.charm.app.name) == {} | ||
_fetch_my_relation_data.assert_called_once_with([2], ["password"]) | ||
|
@@ -265,6 +263,7 @@ def test_update_endpoints_with_event(harness): | |
assert harness.get_relation_data(rel_id, harness.charm.app.name) == { | ||
"endpoints": "1.1.1.1:5432", | ||
"uris": "postgresql://relation-2:[email protected]:5432/test_db", | ||
"tls": "False", | ||
} | ||
assert harness.get_relation_data(another_rel_id, harness.charm.app.name) == {} | ||
|
||
|
@@ -331,11 +330,13 @@ def test_update_endpoints_without_event(harness): | |
"endpoints": "1.1.1.1:5432", | ||
"read-only-endpoints": "2.2.2.2:5432", | ||
"uris": "postgresql://relation-2:[email protected]:5432/test_db", | ||
"tls": "False", | ||
} | ||
assert harness.get_relation_data(another_rel_id, harness.charm.app.name) == { | ||
"endpoints": "1.1.1.1:5432", | ||
"read-only-endpoints": "2.2.2.2:5432", | ||
"uris": "postgresql://relation-3:[email protected]:5432/test_db2", | ||
"tls": "False", | ||
} | ||
_fetch_my_relation_data.assert_called_once_with(None, ["password"]) | ||
|
||
|
@@ -344,8 +345,10 @@ def test_update_endpoints_without_event(harness): | |
assert harness.get_relation_data(rel_id, harness.charm.app.name) == { | ||
"endpoints": "1.1.1.1:5432", | ||
"uris": "postgresql://relation-2:[email protected]:5432/test_db", | ||
"tls": "False", | ||
} | ||
assert harness.get_relation_data(another_rel_id, harness.charm.app.name) == { | ||
"endpoints": "1.1.1.1:5432", | ||
"uris": "postgresql://relation-3:[email protected]:5432/test_db2", | ||
"tls": "False", | ||
} |