Fix failing test for NotLoggedIn
This commit is contained in:
@@ -19,7 +19,6 @@ from fbchat._exception import (
|
|||||||
|
|
||||||
|
|
||||||
ERROR_DATA = [
|
ERROR_DATA = [
|
||||||
(NotLoggedIn, 1357001, "Not logged in", "Please log in to continue."),
|
|
||||||
(
|
(
|
||||||
PleaseRefresh,
|
PleaseRefresh,
|
||||||
1357004,
|
1357004,
|
||||||
@@ -71,6 +70,16 @@ def test_handle_payload_error(exception, code, summary, description):
|
|||||||
handle_payload_error(data)
|
handle_payload_error(data)
|
||||||
|
|
||||||
|
|
||||||
|
def test_handle_not_logged_in_error():
|
||||||
|
data = {
|
||||||
|
"error": 1357001,
|
||||||
|
"errorSummary": "Not logged in",
|
||||||
|
"errorDescription": "Please log in to continue.",
|
||||||
|
}
|
||||||
|
with pytest.raises(NotLoggedIn, match="Not logged in"):
|
||||||
|
handle_payload_error(data)
|
||||||
|
|
||||||
|
|
||||||
def test_handle_payload_error_no_error():
|
def test_handle_payload_error_no_error():
|
||||||
assert handle_payload_error({}) is None
|
assert handle_payload_error({}) is None
|
||||||
assert handle_payload_error({"payload": {"abc": ["Something", "else"]}}) is None
|
assert handle_payload_error({"payload": {"abc": ["Something", "else"]}}) is None
|
||||||
|
Reference in New Issue
Block a user