Skip to content

Commit

Permalink
Sort out some tests
Browse files Browse the repository at this point in the history
Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Dec 4, 2023
1 parent 89eeb31 commit 67fb6bf
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions tests/whitebox/integration/test_stratis.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

# isort: LOCAL
from stratis_cli import StratisCliErrorCodes, run
from stratis_cli._actions import _dynamic
from stratis_cli._errors import StratisCliStratisdVersionError

from ._misc import RUNNER, TEST_RUNNER, RunTestCase, SimTestCase
Expand Down Expand Up @@ -76,15 +77,13 @@ def test_outdated_stratisd_version(self):
Verify that an outdated version of stratisd will produce a
StratisCliStratisdVersionError.
"""
# pylint: disable=import-outside-toplevel
# isort: LOCAL
from stratis_cli._actions import _data
Manager0 = _dynamic.make_dyn_class("Manager0")

command_line = ["--propagate", "daemon", "version"]

# pylint: disable=protected-access
with patch.object(
_data.Manager0.Properties.Version,
_dynamic._LOOKUP["Manager0"][2].Properties.Version,
"Get",
return_value="1.0.0",
):
Expand All @@ -107,12 +106,12 @@ def test_catch_keyboard_exception(self):
at the calling method generated by dbus-python-client-gen.
"""

# pylint: disable=import-outside-toplevel
# isort: LOCAL
from stratis_cli._actions import _data
Manager0 = _dynamic.make_dyn_class("Manager0")

with patch.object(
_data.Manager0.Properties.Version, "Get", side_effect=KeyboardInterrupt()
_dynamic._LOOKUP["Manager0"][2].Properties.Version,
"Get",
side_effect=KeyboardInterrupt(),
):
with self.assertRaises(KeyboardInterrupt):
run()(["daemon", "version"])

0 comments on commit 67fb6bf

Please sign in to comment.