MCPcopy
hub / github.com/praw-dev/praw / test_raise_api_exception

Method test_raise_api_exception

tests/integration/test_objector.py:18–24  ·  view source on GitHub ↗
(self, reddit)

Source from the content-addressed store, hash-verified

16 reddit.submission("4b1tfm").hide()
17
18 def test_raise_api_exception(self, reddit):
19 message = "USER_REQUIRED: 'Please log in to do that.'"
20 submission = reddit.submission("4b536h")
21 with pytest.raises(RedditAPIException) as excinfo:
22 submission.mod.approve()
23 assert excinfo.value.items[0].error_type == "USER_REQUIRED"
24 assert str(excinfo.value.items[0]) == message

Callers

nothing calls this directly

Calls 2

approveMethod · 0.80
submissionMethod · 0.45

Tested by

no test coverage detected