Skip to content

Commit 4b9cfd6

Browse files
committed
test count & export
1 parent ecf594c commit 4b9cfd6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/test_collection.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,24 @@ def test_find():
4040
assert student_info.find(limit=(1, 10)) # Returns doc[1] to doc[9] of all Documents.
4141

4242

43+
def test_count_item():
44+
_query_1 = {"name": "Sam"}
45+
46+
assert student_info.find().count_item()
47+
assert student_info.find(query=_query_1).count_item()
48+
assert student_info.find(query=_query_1, limit=(1, 3)).count_item()
49+
assert student_info.find(limit=(1, 10)).count_item()
50+
51+
52+
def test_export():
53+
_query_1 = {"name": "Sam"}
54+
55+
student_info.find().export("test-db-Sam-1", "test_data/export")
56+
student_info.find(query=_query_1).export("test-db-Sam-2", "test_data/export")
57+
student_info.find(query=_query_1, limit=(1, 3)).export("test-db-Sam-3", "test_data/export")
58+
student_info.find(limit=(1, 10)).export("test-db-Sam-4", "test_data/export")
59+
60+
4361
def test_delete():
4462
assert student_info.delete({"name": "Addy"})
4563
assert student_info.delete({"name": "Sam", "roll": "CSE/17/19"})

0 commit comments

Comments
 (0)