refactor: improve validate_command_output, and move it out of the miner rpc api.

This commit is contained in:
UpstreamData
2024-01-26 09:51:09 -07:00
parent ac7f41be44
commit c2b6cc7468
4 changed files with 48 additions and 86 deletions

View File

@@ -49,6 +49,23 @@ class TestAPIBase(unittest.IsolatedAsyncioTestCase):
).encode("utf-8")
def get_success_value(self, command: str):
if self.api_str == "BTMiner" and command == "status":
return json.dumps(
{
"STATUS": "S",
"When": 1706287567,
"Code": 131,
"Msg": {
"mineroff": "false",
"mineroff_reason": "",
"mineroff_time": "",
"FirmwareVersion": "20230911.12.Rel",
"power_mode": "",
"hash_percent": "",
},
"Description": "",
}
).encode("utf-8")
return json.dumps(
{
"STATUS": [