Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update unit test docstring and data #164

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
""" fwupdmgr json outputs """

"""This file provides fwupdmgr outputs for unit tests"""

"""normal output of `fwupdmgr get-results <DeviceId> --json`"""
GET_RESULTS_RESPONSE_DATA = """{
"Name" : "System Firmware",
"DeviceId" : "a45df35ac0e948ee180fe216a5f703f32dda163f",
Expand Down Expand Up @@ -68,6 +68,7 @@
}
"""

"""output of `fwupdmgr get-results <DeviceId> --json` with error"""
GET_RESULTS_ERROR_RESPONSE_DATA = """
{
"Error" : {
Expand All @@ -78,6 +79,7 @@
}
"""

"""output of `fwupdmgr get-devices --json`"""
GET_DEVICES_RESPONSE_DATA = """{
"Devices" : [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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", ""
Expand All @@ -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 (
Expand All @@ -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",
)

Expand Down