コード例 #1
0
def test_reply_error_empty_message():
    s = str(nbd.ReplyError(5, ""))
    assert s == "Server error: [Error 5] Input/output error"
コード例 #2
0
def test_reply_error_simple():
    s = str(nbd.ReplyError(1, "Simple reply failed"))
    assert s == "Simple reply failed: [Error 1] Operation not permitted"
コード例 #3
0
def test_reply_error_unknown_code():
    s = str(nbd.ReplyError(-1, "bad error"))
    assert s == "Bad error: [Error -1] Unknown error -1"
コード例 #4
0
def test_reply_error_structured():
    s = str(nbd.ReplyError(28, "writing to file failed"))
    assert s == "Writing to file failed: [Error 28] No space left on device"