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

Add tests for utils.py #35

Closed
Gonmeso opened this issue Apr 17, 2024 · 8 comments
Closed

Add tests for utils.py #35

Gonmeso opened this issue Apr 17, 2024 · 8 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers ODHack

Comments

@Gonmeso
Copy link
Contributor

Gonmeso commented Apr 17, 2024

Currently, only models.py and agents.py have some kind of testing, the focus of this issue is to add tests to the utils.py script.

Some tips on this:

  • Use patch or patch.object for the clients
  • When patching return a value of the schema needed. These schemas can be found in the cli repo
  • Make sure to test exceptions

An example:

from giza.schemas import SchemaClass

schema_object = SchemaClass(
    ...
)

@patch("giza_actions.utils.ClientToPatch.method", return_value=schema_object)
def test_something(mock_schema):
    # Test Here
    ...
    # Assert result
    mock_schema.assert_called_once()
@Gonmeso Gonmeso added enhancement New feature or request good first issue Good for newcomers labels Apr 17, 2024
@stevencartavia
Copy link

Hi, can I take this?

@adrianvrj
Copy link
Contributor

Hello, can I hop on this?

@EmmanuelAR
Copy link
Contributor

Hey @Gonmeso , i can help too to add some test!!
Is still posible?
We can, between the 3 of us (we are from Costa Rica), divide the methods to test them, it could be a solution

@raphaelDkhn
Copy link
Contributor

raphaelDkhn commented Apr 22, 2024

Hey guys ODHack just opened, I can assign it to you :)

Would you like me to create a group so that you can communicate on this PR?

@EmmanuelAR
Copy link
Contributor

Sure, excellent, let us create a group and divided the work, thanks @raphaelDkhn!!

@EmmanuelAR
Copy link
Contributor

Hey @raphaelDkhn we see that there are three methods to test in utils.py, so we decided to devided in this way:

@EmmanuelAR
Copy link
Contributor

EmmanuelAR commented Apr 23, 2024

Hey team!
Heres my Pr from my part team #43
Any question, let me know! 😄

cc @Gonmeso @adrianvrj @stevencartavia

@Gonmeso
Copy link
Contributor Author

Gonmeso commented Apr 26, 2024

Fixed in #45 #43 #42

@Gonmeso Gonmeso closed this as completed Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers ODHack
Projects
None yet
Development

No branches or pull requests

5 participants