insanum / gcalcli

Google Calendar Command Line Interface
MIT License
3.3k stars 311 forks source link

many of the tests aren't doing what they should #367

Open jcrowgey opened 6 years ago

jcrowgey commented 6 years ago

Because many of the GoogleCalendarInterface methods return None on error (rather than raising) and because many of the tests just run the method without asserting, we're not getting good software testing in many cases.

I'm working on a commit to fix this. But I wanted to document the issue as well for more transparency into what the commit is trying to achieve.

jcrowgey commented 6 years ago

This is partially addressed by 994c44fb3f33592dc13857661ed03790a4d208f8, but I will leave this issue open because that commit also introduced several todos in the code related to mocking the API response which replies with an event list. I will resolve this ticket once we have proper nonzero asserts on the AddQuery and QuickAddEvent tests (and maybe some others)

yulqen commented 5 years ago

I'm happy to contribute with this work if you can indicate which way you'd like to take it. I guess the key thing will how to handle a mocked API response that services multiple requirements (such as a list of mock events, etc), possibly. Having a solid test suite will make things easier to make other changes required to get a 4.0 release out the door I'd guess.

jcrowgey commented 5 years ago

It seems like you're on the right track. We need to mock the happy path response from the API. We may actually need to handle the AddQuery and QuickAddEvent stuff as an integration test.