From 013cf15024c7ab979866b900ed7ac976c199baa7 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sat, 12 Aug 2023 14:51:44 +0100 Subject: [PATCH] check req_name and code for OBSSDKRequestError class --- tests/test_error.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_error.py b/tests/test_error.py index 721c965..e083187 100644 --- a/tests/test_error.py +++ b/tests/test_error.py @@ -7,7 +7,7 @@ from tests import req_cl class TestErrors: __test__ = True - def test_it_raises_an_obssdk_error_on_bad_connection_info(self): + def test_it_raises_an_obssdk_error_on_incorrect_password(self): bad_conn = {"host": "localhost", "port": 4455, "password": "incorrectpassword"} with pytest.raises( obsws.error.OBSSDKError, @@ -27,5 +27,9 @@ class TestErrors: with pytest.raises( obsws.error.OBSSDKRequestError, match="Request SetCurrentProgramScene returned code 600. With message: No source was found by the name of `invalid`.", - ): + ) as exc_info: req_cl.set_current_program_scene("invalid") + + e = exc_info.value + assert e.req_name == "SetCurrentProgramScene" + assert e.code == 600