Skip to content

Commit 386aa7d

Browse files
committed
Remove no cover pragma
Signed-off-by: mulhern <amulhern@redhat.com>
1 parent f4ffe05 commit 386aa7d

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

src/stratis_cli/_actions/_formatting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

tests/integration/pool/test_list.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
"""
1717

1818
# isort: STDLIB
19+
from unittest.mock import patch
1920
from 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
2526
from 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)

0 commit comments

Comments
 (0)