Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast api course #552

Merged
merged 9 commits into from
Mar 18, 2022
Merged

Fast api course #552

merged 9 commits into from
Mar 18, 2022

Conversation

lhain08
Copy link
Contributor

@lhain08 lhain08 commented Mar 15, 2022

Issue

Note which issue number(s) this Pull Request closes. All pull requests should close an issue, if one does not exists, make one. This helps us plan and discuss before we decide on implementation

Example:

closes #113

Database Changes/Migrations

If you added/modified a table, notify people of schema change here

Example:

Added table account_semester_selection for a mapping from a students account and semester to a class and section (aka class/section selections)

Test Modifications

Note added unit/integration tests: (all backend changes should contain unit/integration tests with pytest)

Example:

Added test tests/api/db/test_classinfo.py:test_crn_uniqueness to ensure all classes returned from API call don't have repeat CRNs

Test Procedure

Show procedure to test functionality with a clear procedure

Example:

  1. Create a branch
  2. Commit a change to that branch
  3. Push branch
  4. Create Pull Request and fill in PR template

Photos

Show before and after, capture screenshot/gif of finished feature/bug

Additional Info

More info that would help people review your change

Xies3 added 3 commits March 18, 2022 16:05
Change ways of writing to examine whether the course is successfully delete or not
@lhain08 lhain08 merged commit 4435ccf into FastAPI Mar 18, 2022
@lhain08 lhain08 deleted the FastAPI-course branch March 18, 2022 20:27
lhain08 added a commit that referenced this pull request Apr 5, 2022
* Added example pytests

* fastapi testing framework

* added additional notes for how to test

* additional notes

* Pushed Project Plan

* added branch names

* updated pytest dependencies

* update requirements

* Fast api session (#523)

* update requirements

* added session test cases

* Create test_user_course.py

* Revert "Create test_user_course.py"

This reverts commit 841505d.

* updated client to use sessions

* updated the pytests to use conftest.py instead of fixtures.py

* Finished first draft of tests for class and department endpoints (#533)

* Finished first draft of tests for class and department endpoints

* Fixed issues with the first draft tests

* made recommended changes and added note to class endpoint check about admin non-public semesters

* cleared __init__

* Fast api update session (#539)

* preliminary fastapi converting

* converted to FastAPI

* implemented fastapi-cache

* removed backup

* removed no longer needed commented code

* removed no longer needed commented code

* converted pytests to use FastAPI TestClient, added automation script

* moved markers from conftest to .ini

* added documentation for how to update endpoints and added CI for running tests

* commented out tests that need updating

* added missing requirement

* set env variables

* automated database cleaning

* updated old mock_cache to work for fastapi-cache so old pytests work

* uncommented CI step for old pytests

* semester and subsemester tests (#536)

* semester and subsemester tests

* updated comments

* Fast api course and event (#537)

* Create test_user_course.py

* Update test_user_course.py

* Update failure case and minor change on success post

* Minor changes

* Debugging json on line 26

* Passed post success and failure for user/course

* Clear comments for pr requirements

* Added not authorized test and followed pr requirements

* removed prints

* Updated delete to actually delete user and not just disable the account

* updated delete to remove all user's course selections when deleting user account

* Fast api semester info + Default Semester (#545)

* Finished Semester Info Endpoint

* Finished Default Semester Endpoint

* Fast api user get and put (#540)

* added session test cases

* test

* test user-get success

* test user get false

* test user put

* Fixed test client sessions

* delete cookie, using session

* delete unrelated comments

* add post_user

* add test_get_user_after_session_closed

* test put user after session closed

* remove unrelated code

* remove print

Co-authored-by: Liam Haining <[email protected]>

* put directory in quotes to avoid bugs with spaces in directory

* replaced missing quotation

* Fast api user post and delete (#541)

* Create user.py

* Delete user.py

* Create flasktest.py

* passed user post test

* test case for delete

* all test cases

* change based on comments

* Update .gitignore

* Delete yacs.n.iml

* Delete workspace.xml

* Delete modules.xml

* Delete vcs.xml

* Delete runConfigurations.xml

* removed .idea/.gitignore

Co-authored-by: Liam Haining <[email protected]>

* Fast api conversion department class (#551)

* First conversion draft

* fixed mistakes

Co-authored-by: canghiskhan <calvinang@icloud>

* Fast api course (#552)

* user_course_get_success

* create a user course delete success function

* update the delete failure function and add code to log out the session in the success cases

* add failure cases for get and delete

* add failure cases for get and delete

* Update test_user_course_delete.py

Change ways of writing to examine whether the course is successfully delete or not

* delete trivial spaces and all the prints

Co-authored-by: Xies3 <[email protected]>

* wrote test cases for default semester set and map date range (#554)

Co-authored-by: Sachin Khanijow <[email protected]>

* added Depends and Optionals

* Fast api conversion default semester (#556)

* finished app.py

* updated tests

* Fast api conversion subsemester (#553)

* rc/api/tests/test.sh
:wq
:wq
�

* revert env variable

* updated endpoint tests

* updated second endpoint test

* corrected fastapi import to fastapi.testclient

* debig app.py

* pydantic -> str

* attempt 1 updating endpoint subsemester with dependency injection, and test subsemester with Optional param

* updated app.py and api_models.py for depends

* fixed testclient import

* added pytest mark to other tests

* refixed import after I overwrote it

* refixed import after I overwrote it

* accidentally changed connection.py

* cleaning up unnecessary imports and comments

Co-authored-by: Liam Haining <[email protected]>
Co-authored-by: Liam Haining <[email protected]>

* Fast api conversion course and event (#555)

* Create test_user_course.py

* Update test_user_course.py

* Update failure case and minor change on success post

* Minor changes

* Debugging json on line 26

* Passed post success and failure for user/course

* Clear comments for pr requirements

* Added not authorized test and followed pr requirements

* Update endpoints step 1

* Update in pydantic model

* Status to Status_code

* Change api naming conversion to FastAPI

* Debugging pytest

* Fixed Post success and post failure pytest method

* Change api_model datatype to str

* newest update

* Fixed the 422 Issue by removing user_id parameter

* Undo some changes

Co-authored-by: Liam Haining <[email protected]>

* Fastapi conversion user post delete (#558)

* add user model

* API conversion

Co-authored-by: Liam Haining <[email protected]>

* removed incomplete dependencies

* removed incomplete dependencies

* removed incomplete dependencies

* dockerizing tests

* fixed naming conflicts

* Fast api conversion user get and put (#560)

* some brief changes

* test

* add to api_models

* change some fastapi tests

* try chaning to fastapi

* current progress

* request.session

* not in request.session

* request: Request

* status_code

* test bug

* change test client back

* remove unrelated comment

* Fast api conversion defaultsemesterset (#563)

* app.py

* fix?

* fixed tests

Co-authored-by: Sachin Khanijow <[email protected]>

* removed print

* user course fix

* Fast api conversion course (#564)

* modify the api user course delete function

* fastapi-conversion-course-get-and-delete

* arg for remove_selection

* merged logically similar test files

* merged logically similar test files

* fix

* removed extra dependencies

* bug fixes

* codefactor is picky

* updated flask related things to fastapi

* fixed start script

* removing unused code

Co-authored-by: YuetingLiao <[email protected]>
Co-authored-by: canghiskhan <[email protected]>
Co-authored-by: PhoenixTamaoki <[email protected]>
Co-authored-by: navyaa-24 <[email protected]>
Co-authored-by: hhdtc <[email protected]>
Co-authored-by: franchen28 <[email protected]>
Co-authored-by: canghiskhan <calvinang@icloud>
Co-authored-by: Xies3 <[email protected]>
Co-authored-by: vancouver02 <[email protected]>
Co-authored-by: Sachin Khanijow <[email protected]>
Co-authored-by: Sachin Khanijow <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants