def METHOD_NAME(self):
    api = self.mock_api(failure_status_code=502)
    with pytest.raises(RemoteInitiatedServerError) as excinfo:
        api.remote_pin_test("key", "pin")
    assert "Got unexpected response code 502. Content: Error 502" in str(excinfo.value)