ryansurf / cli-surf

Get surf and ocean data from the command line interface
MIT License
18 stars 29 forks source link

Test cases! #16

Open ryansurf opened 4 months ago

ryansurf commented 4 months ago

New test cases are always welcome, no matter how simple! This can be a good way to learn how to write simple unit tests and learn PyTest.

Tests are written in /tests

K-dash commented 4 months ago

@ryansurf Hi👋

I think the first thing we should tackle is separating the test code by file. As a starting point, I'll try creating the unit tests for Flask on my end:)

ryansurf commented 4 months ago

@K-dash agreed.

I'll separate the current tests in test_code.py into their proper files. I'm thinking files like test_helper.py, test_apis.py, test_server.py to test helper functions, functions that make API calls and the flask server, respectively. Thoughts?

K-dash commented 4 months ago

@ryansurf

I agree :) I was thinking of splitting the test files exactly as you mentioned.

Also, since pytest can generate test coverage reports, I would like to add that as well.

ryansurf commented 4 months ago

@K-dash Haha nice

I actually didn't even know that was a thing, just googled it. That's super cool. When I made test_code.py that was the first time I've implemented testing, still getting the hang of best practices.

Do you wanna take care of this one? I'm logging off for the night, I can do it tomorrow unless you wanna tackle it :0

K-dash commented 4 months ago

@ryansurf I'd be happy to :ok_hand: I'll take care of adding the test cases and coverage report for test_server.py.

K-dash commented 4 months ago

@ryansurf I will start working on this once #21 is merged :)

K-dash commented 4 months ago

@ryansurf Thanks for the merge! I'll start implementing the test code.

taaaahahaha commented 1 month ago

Hello @ryansurf Is @K-dash working on Implementing Unit test cases? If not, I'd like to contribute. Additionally, I was thinking of using sonarqube to improve code smells, duplications and more.

K-dash commented 1 month ago

@taaaahahaha Hi! Since I am not working on this issue right now, please try to work on it!

taaaahahaha commented 1 month ago

Sure, I'm happy to.

Do assign the issue to me and I'll get started. @ryansurf

ryansurf commented 1 month ago

@taaaahahaha

Sounds good, let me know if you need any help

taaaahahaha commented 1 month ago

Hello, @ryansurf @K-dash I've went through the library, and here are my thoughts.

ryansurf commented 1 month ago

Hey @taaaahahaha

cmagapu commented 3 weeks ago

@ryansurf is anyone working on Implementing Unit test cases? If not, I'd like to contribute. I'm new to open source, and I think unit tests are a good way to get me started.

ryansurf commented 2 weeks ago

@cmagapu Please do! Let me know if you run into any issues