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

Unit/Integration Tests #14

Open
hbusul opened this issue Dec 23, 2021 · 1 comment · May be fixed by #34
Open

Unit/Integration Tests #14

hbusul opened this issue Dec 23, 2021 · 1 comment · May be fixed by #34
Assignees

Comments

@hbusul
Copy link
Owner

hbusul commented Dec 23, 2021

We are missing tests for the REST API.

  • Add tests
  • Add test coverage
  • Add Github workflow so that when a new commit is pushed, tests are run automatically.
@shiny-apricot shiny-apricot self-assigned this Dec 31, 2021
@emrdagkusu
Copy link
Collaborator

We need to add tests for auto-validated attributes by pydantic. For example, if we give 8 for the "day" attribute in the AbsenceModel, it should return 422 Unprocessable Entity and a message.

Example Models:

class AbsenceModel(BaseModel):
    week: int = Field(..., ge=0)
    day: int = Field(..., ge=0, le=4)
    hour: int = Field(..., ge=0, le=15)
    isLab: int = Field(..., ge=0, le=1)
class LessonModel(BaseModel):
    id: PyObjectId = Field(default_factory=PyObjectId, alias="_id")
    name: str = Field(..., min_length=1)
    instructor: str = Field(..., min_length=1)
    absenceLimit: int = Field(..., ge=0)
    slots: List[SlotModel] = Field(...)
    absences: List[AbsenceModel] = []

@emrdagkusu emrdagkusu linked a pull request Mar 17, 2022 that will close this issue
@emrdagkusu emrdagkusu linked a pull request Mar 17, 2022 that will close this issue
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 a pull request may close this issue.

3 participants