Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Work Log with a Database

Harin Yuwarattanaporn
Harin Yuwarattanaporn
8,427 Points

Help on worklog with database project test

I try to make test of main program of worklog with database project. What I can think of is to make new table entry and test that it is exist and correct. The rest of my code is mostly about program menu & navigation, I have no idea how to test them. I can make coverage just only 13%. Any idea?

2 Answers

Tatiana Vasilevskaya
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Tatiana Vasilevskaya
Python Web Development Techdegree Graduate 28,600 Points

You could for example mock user input to test program behaviour for various user inputs. This way you could test menu, navigation, how your program deals with the wrong input, and so on.

Harin Yuwarattanaporn
Harin Yuwarattanaporn
8,427 Points

I tried to learn how to mock things but seems too complex to understand at this stage. Could you provide a basic level example of how to test menu and navigation?

Apiwat Phong
Apiwat Phong
39 Points

Thank you for your suggestion, I would try it !

Harin Yuwarattanaporn
Harin Yuwarattanaporn
8,427 Points

Oh sorry, My friend login and I forgot to logout. That is actually me. Thanks again!