fixed platform not moving problem
This commit is contained in:
@@ -52,3 +52,45 @@ def test_an_unknown_code_points_at_zdevelop():
|
||||
|
||||
def test_a_documented_code_gets_no_hint_appended():
|
||||
assert errors.describe_with_hint(30000) == errors.describe(30000)
|
||||
|
||||
|
||||
# ------------------------------------------------- host-library (PC) codes
|
||||
|
||||
|
||||
def test_a_host_library_code_is_not_sent_to_the_firmware_table():
|
||||
"""``20008`` is not a controller code: ZDevelop cannot have it.
|
||||
|
||||
It is what ``ZAux_OpenEth`` returned on the first, transient attempt at the
|
||||
bench, and the old text sent the operator to a table that cannot contain it.
|
||||
"""
|
||||
message = errors.describe_with_hint(20008)
|
||||
|
||||
assert "20008" in message
|
||||
assert errors.UNKNOWN_HINT not in message
|
||||
assert "上位机" in message
|
||||
assert errors.HOST_LIB_HINT_ZH in message
|
||||
|
||||
|
||||
def test_the_host_library_hint_is_localised():
|
||||
zh = errors.describe_with_hint(20008)
|
||||
en = errors.describe_with_hint(20008, language="en_US")
|
||||
|
||||
assert errors.HOST_LIB_HINT_EN in en
|
||||
assert zh != en
|
||||
|
||||
|
||||
@pytest.mark.parametrize("code", [20000, 20008, 25000, 29999])
|
||||
def test_the_host_library_range_is_recognised(code):
|
||||
assert errors.is_host_lib_error(code)
|
||||
assert "错误码" not in errors.describe(code)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("code", [19999, 30000, 30005, 12345, 222, 0])
|
||||
def test_codes_outside_the_host_range_are_not_labelled_as_library_faults(code):
|
||||
assert not errors.is_host_lib_error(code)
|
||||
|
||||
|
||||
def test_a_controller_code_keeps_the_firmware_hint():
|
||||
"""222 is firmware (``Other error``), so ZDevelop is still the right pointer."""
|
||||
message = errors.describe_with_hint(222)
|
||||
assert errors.UNKNOWN_HINT in message
|
||||
|
||||
Reference in New Issue
Block a user