-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from qitpy/update/deprecated-beanie-config-and…
…-add-tests Update deprecated beanie config and add UnitTests
- Loading branch information
Showing
22 changed files
with
214 additions
and
74 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
DATABASE_URL=mongodb://mongodb:27017/lms | ||
DATABASE_URL=mongodb://localhost:27017/lms | ||
secret_key=guiyfgc837tgf3iw87-012389764 |
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 |
---|---|---|
|
@@ -102,8 +102,7 @@ celerybeat.pid | |
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.env.* | ||
.env.dev | ||
.venv | ||
env/ | ||
venv/ | ||
|
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
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
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
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import uvicorn | ||
|
||
if __name__ == '__main__': | ||
uvicorn.run('app:app', host="0.0.0.0", port=8080, reload=True) | ||
if __name__ == "__main__": | ||
uvicorn.run("app:app", host="0.0.0.0", port=8080, reload=True) |
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,4 @@ | ||
from models.admin import Admin | ||
from models.student import Student | ||
|
||
__all__ = [Student, Admin] |
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 |
---|---|---|
|
@@ -8,26 +8,23 @@ class Admin(Document): | |
email: EmailStr | ||
password: str | ||
|
||
class Collection: | ||
name = "admin" | ||
|
||
class Config: | ||
schema_extra = { | ||
"example": { | ||
"fullname": "Abdulazeez Abdulazeez Adeshina", | ||
"email": "[email protected]", | ||
"password": "3xt3m#" | ||
"password": "3xt3m#", | ||
} | ||
} | ||
|
||
class Settings: | ||
name = "admin" | ||
|
||
|
||
class AdminSignIn(HTTPBasicCredentials): | ||
class Config: | ||
schema_extra = { | ||
"example": { | ||
"username": "[email protected]", | ||
"password": "3xt3m#" | ||
} | ||
"example": {"username": "[email protected]", "password": "3xt3m#"} | ||
} | ||
|
||
|
||
|
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 |
---|---|---|
|
@@ -18,10 +18,13 @@ class Config: | |
"email": "[email protected]", | ||
"course_of_study": "Water resources engineering", | ||
"year": 4, | ||
"gpa": "3.76" | ||
"gpa": "3.76", | ||
} | ||
} | ||
|
||
class Settings: | ||
name = "student" | ||
|
||
|
||
class UpdateStudentModel(BaseModel): | ||
fullname: Optional[str] | ||
|
@@ -40,7 +43,7 @@ class Config: | |
"email": "[email protected]", | ||
"course_of_study": "Water resources and environmental engineering", | ||
"year": 4, | ||
"gpa": "5.0" | ||
"gpa": "5.0", | ||
} | ||
} | ||
|
||
|
@@ -57,6 +60,6 @@ class Config: | |
"status_code": 200, | ||
"response_type": "success", | ||
"description": "Operation successful", | ||
"data": "Sample data" | ||
"data": "Sample data", | ||
} | ||
} |
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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
motor~=2.5.1 | ||
PyJWT~=2.4.0 | ||
bcrypt | ||
uvicorn~=0.17.6 | ||
pymongo~=3.12.3 | ||
fastapi~=0.78.0 | ||
pydantic[email,dotenv]~=1.9.0 | ||
passlib~=1.7.4 | ||
motor #3.1.1 | ||
PyJWT | ||
bcrypt # 4.0.1 | ||
uvicorn # 0.21.1 | ||
pymongo # 4.3.3 | ||
fastapi # 0.95.0 | ||
pydantic[email,dotenv] #1.10.7 | ||
passlib # 1.7.4 | ||
|
||
beanie~=1.10.8 | ||
beanie # 1.18.0 | ||
pytest # 7.3.1 | ||
httpx # 0.24.0 | ||
mongomock_motor # 0.0.19 | ||
pytest-mock # 3.10.0 |
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
Empty file.
Oops, something went wrong.