2323
2424# isort: LOCAL
2525from stratis_cli import StratisCliErrorCodes , run
26+ from stratis_cli ._actions import _dynamic
2627from stratis_cli ._errors import StratisCliStratisdVersionError
2728
2829from ._misc import RUNNER , TEST_RUNNER , RunTestCase , SimTestCase
@@ -76,15 +77,16 @@ def test_outdated_stratisd_version(self):
7677 Verify that an outdated version of stratisd will produce a
7778 StratisCliStratisdVersionError.
7879 """
79- # pylint: disable=import-outside-toplevel
80- # isort: LOCAL
81- from stratis_cli . _actions import _data
80+ Manager0 = _dynamic . make_dyn_class (
81+ "Manager0"
82+ ) # pylint: disable=unused-variable
8283
8384 command_line = ["--propagate" , "daemon" , "version" ]
8485
85- # pylint: disable=protected-access
8686 with patch .object (
87- _data .Manager0 .Properties .Version ,
87+ _dynamic ._LOOKUP ["Manager0" ][
88+ 2
89+ ].Properties .Version , # pylint: disable=protected-access
8890 "Get" ,
8991 return_value = "1.0.0" ,
9092 ):
@@ -107,12 +109,16 @@ def test_catch_keyboard_exception(self):
107109 at the calling method generated by dbus-python-client-gen.
108110 """
109111
110- # pylint: disable=import-outside-toplevel
111- # isort: LOCAL
112- from stratis_cli . _actions import _data
112+ Manager0 = _dynamic . make_dyn_class (
113+ "Manager0"
114+ ) # pylint: disable=unused-variable
113115
114116 with patch .object (
115- _data .Manager0 .Properties .Version , "Get" , side_effect = KeyboardInterrupt ()
117+ _dynamic ._LOOKUP ["Manager0" ][
118+ 2
119+ ].Properties .Version , # pylint: disable=protected-access
120+ "Get" ,
121+ side_effect = KeyboardInterrupt (),
116122 ):
117123 with self .assertRaises (KeyboardInterrupt ):
118124 run ()(["daemon" , "version" ])
0 commit comments