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 044e083
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 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,14 @@ 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
_dynamic.make_dyn_class("Manager0")

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

# pylint: disable=protected-access
with patch.object(
_data.Manager0.Properties.Version,
_dynamic._LOOKUP["Manager0"][ # pylint: disable=protected-access
2
].Properties.Version,
"Get",
return_value="1.0.0",
):
Expand All @@ -107,12 +107,14 @@ 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
_dynamic.make_dyn_class("Manager0")

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

0 comments on commit 044e083

Please sign in to comment.