|
19 | 19 | # with Crate these terms will supersede the license and you may use the |
20 | 20 | # software solely pursuant to the terms of the relevant commercial agreement. |
21 | 21 |
|
22 | | -import datetime as dt |
23 | 22 | import json |
24 | 23 | import multiprocessing |
25 | 24 | import os |
26 | 25 | import queue |
27 | 26 | import random |
28 | 27 | import socket |
29 | | -import sys |
| 28 | + |
30 | 29 | import time |
31 | | -import traceback |
32 | | -import uuid |
| 30 | + |
33 | 31 | from base64 import b64decode |
34 | | -from decimal import Decimal |
| 32 | + |
35 | 33 | from http.server import BaseHTTPRequestHandler, HTTPServer |
36 | 34 | from multiprocessing.context import ForkProcess |
37 | 35 | from threading import Event, Thread |
|
52 | 50 | Client, |
53 | 51 | _get_socket_opts, |
54 | 52 | _remove_certs_for_non_https, |
55 | | - json_dumps, |
56 | 53 | ) |
57 | 54 | from tests.conftest import REQUEST_PATH, fake_response |
58 | 55 |
|
@@ -273,11 +270,6 @@ def test_duplicate_key_error(): |
273 | 270 | client = Client(servers="localhost:4200") |
274 | 271 | with pytest.raises(IntegrityError, match=expected_error_msg): |
275 | 272 | 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 | | - ) |
281 | 273 |
|
282 | 274 |
|
283 | 275 | @patch(REQUEST_PATH, fail_sometimes) |
@@ -644,15 +636,3 @@ def test_username(self): |
644 | 636 | ) |
645 | 637 | self.assertEqual(TestingHTTPServer.SHARED["username"], "testDBUser") |
646 | 638 | 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