Skip to content

Commit

Permalink
tests: Remove request_unixsocket from tests
Browse files Browse the repository at this point in the history
Signed-off-by: hamistao <[email protected]>
  • Loading branch information
hamistao committed Oct 1, 2024
1 parent de8a355 commit a67d0bb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pylxd/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import pytest
import requests
import requests_unixsocket
import requests.adapters

from pylxd import client, exceptions

Expand Down Expand Up @@ -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."""
Expand Down

0 comments on commit a67d0bb

Please sign in to comment.