Commit b48e773b by Peter Weidenbach

match test added

parent d0a92797
...@@ -19,6 +19,13 @@ class TestAggregate(MongoDbTest): ...@@ -19,6 +19,13 @@ class TestAggregate(MongoDbTest):
self.assertEqual(result[0]['_id'], "c", "should be the first element because it has two ocurrences") self.assertEqual(result[0]['_id'], "c", "should be the first element because it has two ocurrences")
self.assertEqual(result[0]['count'], 2) self.assertEqual(result[0]['count'], 2)
def test_get_objects_and_count_match(self):
self.add_simple_test_data()
result = get_objects_and_count_of_occurrence(self.test_collection, "$test_txt", unwind="False", match={"test_int": 0})
self.assertEqual(len(result), 1, "number of results not correct")
self.assertEqual(result[0]['_id'], "item 0")
print(result)
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment