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

Refactor tests pa #336

Merged
merged 13 commits into from
May 21, 2024
Merged

Refactor tests pa #336

merged 13 commits into from
May 21, 2024

Conversation

panosatha
Copy link
Contributor

@panosatha panosatha commented Jan 19, 2024

  • Small updates in the benefits code to avoid repetative code and add documentation
  • Refactoring of tests for benefits by implementing unit tests for each method

@panosatha panosatha marked this pull request as ready for review May 7, 2024 15:50
@panosatha panosatha requested a review from Santonia27 May 7, 2024 15:54
-------
IBenefit
a Benefit object
"""

obj = Benefit()
with open(filepath, mode="rb") as fp:
toml = tomli.load(fp)
obj.attrs = BenefitModel.parse_obj(toml)
Copy link
Contributor

@Santonia27 Santonia27 May 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parse_object throws an error/warning The method "parse_obj" in class "BaseModel" is deprecated
The parse_obj method is deprecated; use model_validate instead

Do we want to update that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same in line 607 with "dict"

Copy link
Contributor Author

@panosatha panosatha May 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that is the case for all our objects currently after a change in the pydantic version. So this should be solved in a seperate PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a small test for "def save(self, filepath: Union[str, os.PathLike]): ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch!

Copy link
Contributor

@Santonia27 Santonia27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just had minor comments/questions

@panosatha panosatha merged commit 0f745b4 into main May 21, 2024
4 checks passed
@panosatha panosatha deleted the refactor_tests_PA branch May 21, 2024 14:45
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.

3 participants