Skip to content

Commit 307c520

Browse files
simplify mock to not use charm-refresh private api
1 parent 8d4ee79 commit 307c520

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

tests/unit/conftest.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,6 @@ def unit_status_lower_priority(self, *, workload_is_running=True):
5454

5555
@pytest.fixture(autouse=True)
5656
def patch(monkeypatch):
57-
def _tomli_load(*args, **kwargs) -> dict:
58-
return {
59-
"charm_major": 1,
60-
"workload": "8.0.0",
61-
"charm": "v8.0/1.0.0",
62-
"snap": {
63-
"name": "charmed-mysql",
64-
"revisions": {
65-
"x86_64": "1",
66-
"aarch64": "1",
67-
},
68-
},
69-
}
70-
7157
monkeypatch.setattr(
7258
"charm.MachineSubordinateRouterCharm.wait_until_mysql_router_ready",
7359
lambda *args, **kwargs: None,
@@ -79,7 +65,7 @@ def _tomli_load(*args, **kwargs) -> dict:
7965
)
8066
monkeypatch.setattr("mysql_shell.Shell.is_router_in_cluster_set", lambda *args, **kwargs: True)
8167
monkeypatch.setattr("charm_refresh.Machines", _MockRefresh)
82-
monkeypatch.setattr("charm_refresh._main.tomli.load", _tomli_load)
68+
monkeypatch.setattr("charm_refresh.snap_name", lambda: "charmed-mysql")
8369
monkeypatch.setattr(
8470
"relations.database_requires.RelationEndpoint.does_relation_exist",
8571
lambda *args, **kwargs: True,

0 commit comments

Comments
 (0)