Skip to content

Commit

Permalink
Rename machine_charm.py to charm.py (#202)
Browse files Browse the repository at this point in the history
Needed for upcoming charmcraft 3 migration because of
canonical/charmcraft#1994
  • Loading branch information
carlcsaposs-canonical authored Jan 10, 2025
1 parent cf99969 commit 1826232
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ parts:
# TODO: enable after https://github.com/canonical/charmcraft/issues/1456 fixed
charm-strict-dependencies: false
charm-requirements: [requirements.txt]
charm-entrypoint: src/machine_charm.py
charm-entrypoint: src/charm.py
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def disable_tenacity_retry(monkeypatch):
@pytest.fixture(autouse=True)
def patch(monkeypatch):
monkeypatch.setattr(
"machine_charm.MachineSubordinateRouterCharm.wait_until_mysql_router_ready",
"charm.MachineSubordinateRouterCharm.wait_until_mysql_router_ready",
lambda *args, **kwargs: None,
)
monkeypatch.setattr("workload.AuthenticatedWorkload._router_username", "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest
import scenario

import machine_charm
import charm

from . import combinations

Expand All @@ -23,7 +23,7 @@ def output_states(
The output state of each test should be identical for all events.
"""
context = scenario.Context(machine_charm.MachineSubordinateRouterCharm)
context = scenario.Context(charm.MachineSubordinateRouterCharm)
input_state = scenario.State(
relations=[*relations, scenario.PeerRelation(endpoint="upgrade-version-a")],
secrets=secrets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest
import scenario

import machine_charm
import charm

from . import combinations

Expand All @@ -18,7 +18,7 @@ def output_state(
event: scenario.Event,
secrets: list[scenario.Secret] = [],
) -> scenario.State:
context = scenario.Context(machine_charm.MachineSubordinateRouterCharm)
context = scenario.Context(charm.MachineSubordinateRouterCharm)
input_state = scenario.State(
relations=[*relations, scenario.PeerRelation(endpoint="upgrade-version-a")],
secrets=secrets,
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/scenario_/test_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import pytest
import scenario

import machine_charm
import charm


@pytest.mark.parametrize("leader", [False, True])
def test_start_sets_status_if_no_relations(leader):
context = scenario.Context(machine_charm.MachineSubordinateRouterCharm)
context = scenario.Context(charm.MachineSubordinateRouterCharm)
input_state = scenario.State(
leader=leader,
relations=[scenario.PeerRelation(endpoint="upgrade-version-a")],
Expand Down

0 comments on commit 1826232

Please sign in to comment.