Skip to content

Commit

Permalink
Merge pull request #164 from canonical/remove_ip
Browse files Browse the repository at this point in the history
Update unit test docstring and data
  • Loading branch information
nancyc12 authored Nov 29, 2023
2 parents 00fffd3 + 52c1428 commit 0ef7703
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
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

0 comments on commit 0ef7703

Please sign in to comment.