File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ def inner(mo: Any) -> str:
180180 """
181181 try :
182182 return prop_to_str (mo )
183- except DbusClientMissingPropertyError : # pragma: no cover
183+ except DbusClientMissingPropertyError :
184184 return default
185185
186186 return inner
Original file line number Diff line number Diff line change 1616"""
1717
1818# isort: STDLIB
19+ from unittest .mock import patch
1920from uuid import uuid4
2021
2122# isort: FIRSTPARTY
22- from dbus_client_gen import DbusClientUniqueResultError
23+ from dbus_client_gen import DbusClientMissingPropertyError , DbusClientUniqueResultError
2324
2425# isort: LOCAL
2526from stratis_cli import StratisCliErrorCodes
@@ -316,3 +317,24 @@ def test_list_detail(self):
316317 Test detail view on running pool.
317318 """
318319 TEST_RUNNER (self ._MENU + [f"--name={ self ._POOLNAME } " ])
320+
321+ def test_list_no_size (self ):
322+ """
323+ Test listing the pool when size information not included in
324+ GetManagedObjects result.
325+ """
326+ # isort: LOCAL
327+ import stratis_cli # pylint: disable=import-outside-toplevel
328+
329+ with patch .object (
330+ # pylint: disable=protected-access
331+ stratis_cli ._actions ._list_pool .Default , # pyright: ignore
332+ "size_triple" ,
333+ autospec = True ,
334+ raises = DbusClientMissingPropertyError (
335+ "oops" ,
336+ stratis_cli ._actions ._constants .POOL_INTERFACE , # pyright: ignore
337+ "TotalPhysicalUsed" ,
338+ ),
339+ ):
340+ TEST_RUNNER (self ._MENU )
You can’t perform that action at this time.
0 commit comments