Skip to content

Commit 1759c12

Browse files
committed
modified test
1 parent c38c353 commit 1759c12

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

test/__init__.py

Whitespace-only changes.

test/test_collection.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
student_info = db.collection("student_info")
99

1010

11-
def insert_single_document():
11+
def test_insert():
1212
assert student_info.insert({"name": "Sam", "roll": "CSE/17/19", "dept": "CSE"})
1313
assert student_info.insert({"name": "Bob", "roll": "EE/01/18", "dept": "EE", "skill": ["python", "c++"]})
1414
assert student_info.insert({"name": "Rana", "dept": "CSE"})
1515

1616

17-
def insert_multiple_document():
17+
def test_insert_all():
1818
assert student_info.insert_all([
1919
{"name": "Addy", "roll": "ME/57/19", "dept": "ME", "cgpa": 9.05},
2020
{"name": "Roman", "roll": "ECE/80/13", "dept": "ECE", "skill": ["game design"], "spc": ["Blinder"]},
@@ -23,16 +23,15 @@ def insert_multiple_document():
2323
)
2424

2525

26-
def find_document_1():
26+
def test_find():
2727
_query_1 = {"name": "Sam"}
2828

2929
assert student_info.find() # Returns all Documents.
3030
assert student_info.find(query=_query_1) # Returns all Documents matches the ``_query``.
3131
assert student_info.find(query=_query_1, limit=(1, 3)) # Returns doc[1] to doc[2] matches the ``_query``.
3232
assert student_info.find(limit=(1, 10)) # Returns doc[1] to doc[9] of all Documents.
3333

34-
35-
def find_document_2():
34+
# with multiple query
3635
_query_2 = {"name": "Sam", "roll": "CSE/17/19"}
3736

3837
assert student_info.find() # Returns all Documents.
@@ -41,7 +40,7 @@ def find_document_2():
4140
assert student_info.find(limit=(1, 10)) # Returns doc[1] to doc[9] of all Documents.
4241

4342

44-
def delete_document():
43+
def test_delete():
4544
assert student_info.delete({"name": "Addy"})
4645
assert student_info.delete({"name": "Sam", "roll": "CSE/17/19"})
4746
assert student_info.delete({"name": "Roman", "roll": "ECE/80/13", "dept": "ECE"})

0 commit comments

Comments
 (0)