From 3168bff6c90c4dcb6072d694659a2964fdc9491d Mon Sep 17 00:00:00 2001 From: Steffen Maier Date: Wed, 18 Oct 2023 19:17:23 +0200 Subject: [PATCH] fixup! DASDDiscoverTask: use consolidated device configuration with zdev (#1802482,#1937049) As blockdev was already mocked it's not clear to me how the test would mock that sanitize_dev_input would actually canonicalize a DASD device bus-ID. So just check that the new code calls execWithRedirect() exactly once and ignore the arguments. It would be a separate fix patch to improve a fake sanitize unit test. I suppose it would need to start with a DASD device bus-ID that is not yet canonical/sanitized, e.g. something along the lines of: DASDDiscoverTask("A100").run() blockdev.s390.sanitize_dev_input.return_value = "0.0.A100" blockdev.s390.sanitize_dev_input.assert_called_once_with("A100") sanitized_input = blockdev.s390.sanitize_dev_input.return_value execWithRedirect.assert_called_once_with(...) Not sure how much value that would have, though. Signed-off-by: Steffen Maier --- .../pyanaconda_tests/modules/storage/test_module_dasd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/pyanaconda_tests/modules/storage/test_module_dasd.py b/tests/unit_tests/pyanaconda_tests/modules/storage/test_module_dasd.py index ed5c40ce9e9c..7820848021d7 100644 --- a/tests/unit_tests/pyanaconda_tests/modules/storage/test_module_dasd.py +++ b/tests/unit_tests/pyanaconda_tests/modules/storage/test_module_dasd.py @@ -124,13 +124,13 @@ def test_discovery_fails(self): DASDDiscoverTask("x.y.z").run() @patch('pyanaconda.modules.storage.dasd.discover.blockdev') + @patch('pyanaconda.modules.storage.dasd.discover.execWithRedirect') def test_discovery(self, blockdev): """Test the discovery task.""" DASDDiscoverTask("0.0.A100").run() blockdev.s390.sanitize_dev_input.assert_called_once_with("0.0.A100") - sanitized_input = blockdev.s390.sanitize_dev_input.return_value - blockdev.s390.dasd_online.assert_called_once_with(sanitized_input) + execWithRedirect.assert_called_once() @patch('pyanaconda.modules.storage.dasd.format.blockdev') def test_format(self, blockdev):