-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make ErrorType enums compare as strings (#269)
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.
- Loading branch information
Showing
2 changed files
with
8 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
from dbus_fast.constants import MESSAGE_FLAG_MAP, MessageFlag | ||
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 |