Skip to content

Commit 8ff0ca7

Browse files
committed
Fix test
1 parent 194ee10 commit 8ff0ca7

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/test-on-pr-ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
strategy:
2121
matrix:
22-
python-version: ["3.10", "3.11", "3.12", "3.13"]
22+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2323

2424
steps:
2525
- uses: actions/checkout@v4

tests/connection/test_sock.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ def test_socket(self):
1818
"""Test socket connection and data exchange.
1919
"""
2020
# connect
21-
sock = Socket("www.example.com", 80)
21+
sock = Socket("github.com", 80)
2222

2323
# request
2424
sock.sendline(b'GET / HTTP/1.1\r')
25-
sock.send(b'Host: www.example.com\r\n\r\n')
25+
sock.send(b'Host: github.com\r\n\r\n')
2626

2727
# shutdown
2828
sock.close_send()
2929

3030
# receive
31-
result = int(sock.recvlineafter('Content-Length: ')) > 0
31+
status = int(sock.recvregex(r"HTTP/1.1 (\d+) .+").group(1))
3232
sock.close()
3333

34-
self.assertEqual(result, True)
34+
self.assertIn(status, [200, 301]) # OK or Moved permanently
3535

3636
def test_timeout(self):
3737
"""Test socket timeout behavior.

0 commit comments

Comments
 (0)