patx/pickledb
updated tests
Commit b2dc24c · patx · 2025-02-10T14:33:14-05:00
Comments
No comments yet.
Diff
diff --git a/__pycache__/pickledb.cpython-310.pyc b/__pycache__/pickledb.cpython-310.pyc
new file mode 100644
index 0000000..05c3197
Binary files /dev/null and b/__pycache__/pickledb.cpython-310.pyc differ
diff --git a/__pycache__/tests.cpython-310.pyc b/__pycache__/tests.cpython-310.pyc
new file mode 100644
index 0000000..7404aa4
Binary files /dev/null and b/__pycache__/tests.cpython-310.pyc differ
diff --git a/tests.py b/tests.py
index 249caac..0943f39 100644
--- a/tests.py
+++ b/tests.py
@@ -30,7 +30,7 @@ class TestPickleDB(unittest.TestCase):
signal.alarm(timeout_duration)
try:
- num_docs = 20_000_000
+ num_docs = 1_000_000
# Measure memory loading time
start_time = time.time()
@@ -99,8 +99,8 @@ class TestPickleDB(unittest.TestCase):
"""Test initializing a database with a corrupt file."""
with open(self.test_file, 'w') as f:
f.write("corrupt data")
- db = PickleDB(self.test_file)
- self.assertEqual(db.all(), [])
+ with self.assertRaises(RuntimeError):
+ PickleDB(self.test_file)
def test_set_non_string_key(self):
"""Test setting a non-string key."""