mirror of
				https://github.com/onyx-and-iris/obsws-python.git
				synced 2025-11-04 06:41:47 +00:00 
			
		
		
		
	check req_name and code
for OBSSDKRequestError class
This commit is contained in:
		
							parent
							
								
									f88e8ee3a6
								
							
						
					
					
						commit
						013cf15024
					
				@ -7,7 +7,7 @@ from tests import req_cl
 | 
				
			|||||||
class TestErrors:
 | 
					class TestErrors:
 | 
				
			||||||
    __test__ = True
 | 
					    __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"}
 | 
					        bad_conn = {"host": "localhost", "port": 4455, "password": "incorrectpassword"}
 | 
				
			||||||
        with pytest.raises(
 | 
					        with pytest.raises(
 | 
				
			||||||
            obsws.error.OBSSDKError,
 | 
					            obsws.error.OBSSDKError,
 | 
				
			||||||
@ -27,5 +27,9 @@ class TestErrors:
 | 
				
			|||||||
        with pytest.raises(
 | 
					        with pytest.raises(
 | 
				
			||||||
            obsws.error.OBSSDKRequestError,
 | 
					            obsws.error.OBSSDKRequestError,
 | 
				
			||||||
            match="Request SetCurrentProgramScene returned code 600. With message: No source was found by the name of `invalid`.",
 | 
					            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")
 | 
					            req_cl.set_current_program_scene("invalid")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        e = exc_info.value
 | 
				
			||||||
 | 
					        assert e.req_name == "SetCurrentProgramScene"
 | 
				
			||||||
 | 
					        assert e.code == 600
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user