Skip to content

Commit

Permalink
chore: Fix test name
Browse files Browse the repository at this point in the history
  • Loading branch information
gruyaume committed Feb 6, 2024
1 parent aa6180b commit 1e5cb23
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/unit/test_snap.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,17 +291,17 @@ def test_can_run_snap_commands(self, mock_subprocess):
)

@patch("charms.operator_libs_linux.v2.snap.subprocess.check_output")
def test_can_run_snap_commands_devmode(self, mock_subprocess):
mock_subprocess.return_value = 0
def test_can_run_snap_commands_devmode(self, mock_check_output):
mock_check_output.return_value = 0
foo = snap.Snap("foo", snap.SnapState.Present, "stable", "1", "devmode")
self.assertEqual(foo.present, True)

foo.ensure(snap.SnapState.Absent)
mock_subprocess.assert_called_with(["snap", "remove", "foo"], universal_newlines=True)
mock_check_output.assert_called_with(["snap", "remove", "foo"], universal_newlines=True)

foo.ensure(snap.SnapState.Latest, devmode=True, channel="latest/edge")

mock_subprocess.assert_called_with(
mock_check_output.assert_called_with(
[
"snap",
"install",
Expand All @@ -314,10 +314,10 @@ def test_can_run_snap_commands_devmode(self, mock_subprocess):
self.assertEqual(foo.latest, True)

foo.state = snap.SnapState.Absent
mock_subprocess.assert_called_with(["snap", "remove", "foo"], universal_newlines=True)
mock_check_output.assert_called_with(["snap", "remove", "foo"], universal_newlines=True)

foo.ensure(snap.SnapState.Latest, revision=123)
mock_subprocess.assert_called_with(
mock_check_output.assert_called_with(
["snap", "install", "foo", "--devmode", '--revision="123"'], universal_newlines=True
)

Expand Down

0 comments on commit 1e5cb23

Please sign in to comment.