From ee6078e90c367f0607db6a39f8315df15e7744b0 Mon Sep 17 00:00:00 2001 From: hamistao Date: Mon, 30 Sep 2024 22:33:28 -0300 Subject: [PATCH] tests: Remove `request_unixsocket` from tests Signed-off-by: hamistao --- pylxd/tests/test_client.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pylxd/tests/test_client.py b/pylxd/tests/test_client.py index 9d572cca..02d677d7 100644 --- a/pylxd/tests/test_client.py +++ b/pylxd/tests/test_client.py @@ -18,7 +18,7 @@ import pytest import requests -import requests_unixsocket +import requests.adapters from pylxd import client, exceptions @@ -631,13 +631,17 @@ class TestGetSessionForUrl(TestCase): def test_session_unix_socket(self): """http+unix URL return a requests_unixsocket session.""" session = client.get_session_for_url("http+unix://test.com") - self.assertIsInstance(session, requests_unixsocket.Session) + self.assertIsInstance( + session.get_adapter("http+unix://"), requests.adapters.HTTPAdapter + ) def test_session_http(self): """HTTP nodes return the default requests session.""" session = client.get_session_for_url("http://test.com") self.assertIsInstance(session, requests.Session) - self.assertNotIsInstance(session, requests_unixsocket.Session) + self.assertRaises( + requests.exceptions.InvalidSchema, session.get_adapter, "http+unix://" + ) def test_session_cert(self): """If certs are given, they're set on the Session."""