The DBusError exception stores the error type as string. This makes the exception not directly compare to the ErrorType members (for example DBusError(ErrorType.FAILED, "").type != ErrorType.FAILED). This makes ErrorType also a string to make this comparision work.
13 lines
331 B
Python
13 lines
331 B
Python
from dbus_fast.constants import MESSAGE_FLAG_MAP, ErrorType, MessageFlag
|
|
from dbus_fast.errors import DBusError
|
|
|
|
|
|
def test_message_flag_map():
|
|
assert 0 in MESSAGE_FLAG_MAP
|
|
assert MessageFlag.NONE in MESSAGE_FLAG_MAP
|
|
|
|
|
|
def test_error_type():
|
|
err = DBusError(ErrorType.FAILED, "")
|
|
assert ErrorType.FAILED == err.type
|