Fix failing test for NotLoggedIn

This commit is contained in:
Mads Marquart
2020-02-05 15:29:57 +01:00
parent 4df1d5e0d4
commit 0f4ee33d2a

View File

@@ -19,7 +19,6 @@ from fbchat._exception import (
ERROR_DATA = [
(NotLoggedIn, 1357001, "Not logged in", "Please log in to continue."),
(
PleaseRefresh,
1357004,
@@ -71,6 +70,16 @@ def test_handle_payload_error(exception, code, summary, description):
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():
assert handle_payload_error({}) is None
assert handle_payload_error({"payload": {"abc": ["Something", "else"]}}) is None