Skip to content

Commit

Permalink
fix: remove relative import since client can't handle it
Browse files Browse the repository at this point in the history
Signed-off-by: Morgan Epp <[email protected]>
  • Loading branch information
epmog committed Feb 29, 2024
1 parent e27977b commit cb145d2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/openjd/adaptor_runtime_client/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import socket as _socket
import ctypes as _ctypes
import os as _os
from sys import platform
from typing import Any
from http.client import HTTPConnection as _HTTPConnection
from ..adaptor_runtime._osname import OSName


class UnrecognizedBackgroundConnectionError(Exception):
Expand Down Expand Up @@ -86,7 +86,7 @@ def _authenticate(self) -> bool:
peercred_opt_level: Any
peercred_opt: Any
cred_cls: Any
if OSName.is_macos():
if platform == "darwin":
# SOL_LOCAL is not defined in Python's socket module, need to hardcode it
# source: https://github.com/apple-oss-distributions/xnu/blob/1031c584a5e37aff177559b9f69dbd3c8c3fd30a/bsd/sys/un.h#L85
peercred_opt_level = 0 # type: ignore[attr-defined]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_respond_with_body(
mock_wfile.write.assert_called_once_with(body.encode("utf-8"))


@pytest.mark.skipif(not OSName.is_linux() or not OSName.is_macos(), reason="Unix-specific tests")
@pytest.mark.skipif(not OSName.is_posix(), reason="Posix-specific tests")
class TestAuthentication:
"""
Tests for the RequestHandler authentication
Expand Down
4 changes: 2 additions & 2 deletions test/openjd/adaptor_runtime/unit/utils/test_secure_open.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
],
)
@patch.object(os, "open")
@pytest.mark.skipif(not OSName.is_linux(), reason="Linux-specific tests")
def test_secure_open_in_linux(mock_os_open, path, open_mode, mask, expected_os_open_kwargs):
@pytest.mark.skipif(not OSName.is_posix(), reason="Posix-specific tests")
def test_secure_open_in_posix(mock_os_open, path, open_mode, mask, expected_os_open_kwargs):
# WHEN
with patch("builtins.open", mock_open()) as mocked_open:
secure_open_kwargs = {"mask": mask} if mask else {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def close(self, args: _Optional[_Dict[str, _Any]]) -> None:


@pytest.mark.skipif(not OSName.is_posix(), reason="Posix-specific tests")
class TestLinuxClientInterface:
class TestPosixClientInterface:
@pytest.mark.parametrize(
argnames=("original_path", "new_path"),
argvalues=[
Expand Down

0 comments on commit cb145d2

Please sign in to comment.