-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement face lifecycle tests and added mock database functionality
- Loading branch information
Showing
5 changed files
with
100 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from pymongo import MongoClient | ||
from datetime import datetime | ||
|
||
|
||
class Database: | ||
def __init__(self, uri="mongodb://localhost:27017/", db_name="ImageDB"): | ||
self.client = MongoClient(uri) | ||
self.db = self.client[db_name] | ||
|
||
def find(self, collection, query=None): | ||
return self.db[collection].find(query) | ||
|
||
def insert_one(self, collection, document): | ||
return self.db[collection].insert_one(document) | ||
|
||
def find_one(self, collection,filter, projection=None): | ||
return self.db[collection].find_one(filter=filter ,projection=projection) | ||
|
||
def find_one_and_delete(self, collection, query): | ||
return self.db[collection].find_one_and_delete(query) | ||
|
||
def update_one(self, collection, query, update): | ||
return self.db[collection].update_one(query, update) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## [Unreleased] | ||
|
||
### Added | ||
- Implemented all test cases in `test_face_cycle` | ||
- Implemented mock test cases for `test_face_cycle` to work on online runners |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters