Skip to content

Commit

Permalink
fix: remove unused tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeraj319 committed Jan 8, 2025
1 parent 554c978 commit 5961a6f
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions python_client/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
locatr_go_cleanup,
read_data_over_socket,
send_data_over_socket,
spawn_locatr_process,
wait_for_socket,
)
from locatr.exceptions import (
LocatrBinaryNotFound,
LocatrClientServerVersionMisMatch,
LocatrSocketError,
LocatrSocketNotAvailable,
)


Expand All @@ -44,12 +44,6 @@ def test_locatr_go_cleanup(self):
process.kill.assert_called_once()
self.assertFalse(os.path.exists(SocketFilePath.path))

def test_spawn_locatr_process(self):
try:
spawn_locatr_process(["arg1", "arg2"])
except LocatrBinaryNotFound:
self.fail("LocatrBinaryNotFound was raised unexpectedly!")

def test_create_packed_message(self):
message = "test message"
packed_message = create_packed_message(message)
Expand All @@ -58,17 +52,17 @@ def test_create_packed_message(self):
)
self.assertEqual(packed_message, expected_message)

# @patch("socket.socket.connect")
# def test_wait_for_socket(self, mock_connect):
# mock_connect.side_effect = [socket.error] * 5 + [None]
# sock = MagicMock()
# sock.connect = mock_connect
# wait_for_socket(sock)
# self.assertEqual(mock_connect.call_count, 6)

# mock_connect.side_effect = socket.error
# with self.assertRaises(LocatrSocketNotAvailable):
# wait_for_socket(sock)
@patch("socket.socket.connect")
def test_wait_for_socket(self, mock_connect):
mock_connect.side_effect = [socket.error] * 5 + [None]
sock = MagicMock()
sock.connect = mock_connect
wait_for_socket(sock)
self.assertEqual(mock_connect.call_count, 6)

mock_connect.side_effect = socket.error
with self.assertRaises(LocatrSocketNotAvailable):
wait_for_socket(sock)

@patch("socket.socket.send")
def test_send_data_over_socket(self, mock_send):
Expand Down

0 comments on commit 5961a6f

Please sign in to comment.