Skip to content

Commit 8f46388

Browse files
committed
Clean imports
1 parent aa7794f commit 8f46388

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

tests/client/test_http.py

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,17 @@
1919
# with Crate these terms will supersede the license and you may use the
2020
# software solely pursuant to the terms of the relevant commercial agreement.
2121

22-
import datetime as dt
2322
import json
2423
import multiprocessing
2524
import os
2625
import queue
2726
import random
2827
import socket
29-
import sys
28+
3029
import time
31-
import traceback
32-
import uuid
30+
3331
from base64 import b64decode
34-
from decimal import Decimal
32+
3533
from http.server import BaseHTTPRequestHandler, HTTPServer
3634
from multiprocessing.context import ForkProcess
3735
from threading import Event, Thread
@@ -52,7 +50,6 @@
5250
Client,
5351
_get_socket_opts,
5452
_remove_certs_for_non_https,
55-
json_dumps,
5653
)
5754
from tests.conftest import REQUEST_PATH, fake_response
5855

@@ -273,11 +270,6 @@ def test_duplicate_key_error():
273270
client = Client(servers="localhost:4200")
274271
with pytest.raises(IntegrityError, match=expected_error_msg):
275272
client.sql("INSERT INTO testdrive (foo) VALUES (42)")
276-
self.assertEqual(
277-
cm.exception.message,
278-
"DuplicateKeyException[A document with the "
279-
"same primary key exists already]",
280-
)
281273

282274

283275
@patch(REQUEST_PATH, fail_sometimes)
@@ -644,15 +636,3 @@ def test_username(self):
644636
)
645637
self.assertEqual(TestingHTTPServer.SHARED["username"], "testDBUser")
646638
self.assertEqual(TestingHTTPServer.SHARED["password"], "test:password")
647-
648-
649-
class TestCrateJsonEncoder(TestCase):
650-
def test_naive_datetime(self):
651-
data = dt.datetime.fromisoformat("2023-06-26T09:24:00.123")
652-
result = json_dumps(data)
653-
self.assertEqual(result, b"1687771440123")
654-
655-
def test_aware_datetime(self):
656-
data = dt.datetime.fromisoformat("2023-06-26T09:24:00.123+02:00")
657-
result = json_dumps(data)
658-
self.assertEqual(result, b"1687764240123")

0 commit comments

Comments
 (0)