From 52c14282502099074580b707ab2e9af7616f3fc5 Mon Sep 17 00:00:00 2001 From: nancyc12 Date: Tue, 28 Nov 2023 17:19:55 +0800 Subject: [PATCH] update unit test docstring and data --- .../fw_devices/LVFS/tests/fwupd_data.py | 6 ++++-- .../fw_devices/tests/test_firmware_update.py | 10 ++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/device-connectors/src/testflinger_device_connectors/fw_devices/LVFS/tests/fwupd_data.py b/device-connectors/src/testflinger_device_connectors/fw_devices/LVFS/tests/fwupd_data.py index 29d21282..7e4b6b45 100644 --- a/device-connectors/src/testflinger_device_connectors/fw_devices/LVFS/tests/fwupd_data.py +++ b/device-connectors/src/testflinger_device_connectors/fw_devices/LVFS/tests/fwupd_data.py @@ -1,6 +1,6 @@ -""" fwupdmgr json outputs """ - +"""This file provides fwupdmgr outputs for unit tests""" +"""normal output of `fwupdmgr get-results --json`""" GET_RESULTS_RESPONSE_DATA = """{ "Name" : "System Firmware", "DeviceId" : "a45df35ac0e948ee180fe216a5f703f32dda163f", @@ -68,6 +68,7 @@ } """ +"""output of `fwupdmgr get-results --json` with error""" GET_RESULTS_ERROR_RESPONSE_DATA = """ { "Error" : { @@ -78,6 +79,7 @@ } """ +"""output of `fwupdmgr get-devices --json`""" GET_DEVICES_RESPONSE_DATA = """{ "Devices" : [ { diff --git a/device-connectors/src/testflinger_device_connectors/fw_devices/tests/test_firmware_update.py b/device-connectors/src/testflinger_device_connectors/fw_devices/tests/test_firmware_update.py index 834a87e2..9bbcf8c3 100644 --- a/device-connectors/src/testflinger_device_connectors/fw_devices/tests/test_firmware_update.py +++ b/device-connectors/src/testflinger_device_connectors/fw_devices/tests/test_firmware_update.py @@ -27,8 +27,7 @@ def mock_run_cmd_supported(*args, **kwargs): def mock_run_cmd_unsupported(*args, **kwargs): """ - Mock run_cmd for an Intel Desktop device (201808-26453), which - doesn't have a supported Device class. + Mock run_cmd for a device which doesn't have a supported Device class. """ if args[1] == vendor_cmd: return 0, "Default string", "" @@ -37,8 +36,7 @@ def mock_run_cmd_unsupported(*args, **kwargs): def mock_run_cmd_fail(*args, **kwargs): """ - Mock run_cmd for a Rigado Cascade 500 device (201810-26506), which - doesn't provide dmi data. + Mock run_cmd for a device which couldn't provide dmi data. """ if args[1] == vendor_cmd: return ( @@ -63,14 +61,14 @@ def mock_run_cmd_nossh(*args, **kwargs): return ( 255, "", - "ssh: connect to host 10.102.161.93 port 22: " + "ssh: connect to host 10.10.10.10 port 22: " "No route to host", ) elif args[1] == type_cmd: return ( 255, "", - "ssh: connect to host 10.102.161.93 port 22: " + "ssh: connect to host 10.10.10.10 port 22: " "No route to host", )