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 trialHarin Yuwarattanaporn
8,427 PointsHelp 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
Python Web Development Techdegree Graduate 28,600 PointsYou 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
8,427 PointsOh sorry, My friend login and I forgot to logout. That is actually me. Thanks again!
Harin Yuwarattanaporn
8,427 PointsHarin Yuwarattanaporn
8,427 PointsI 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?
Tatiana Vasilevskaya
Python Web Development Techdegree Graduate 28,600 PointsTatiana Vasilevskaya
Python Web Development Techdegree Graduate 28,600 PointsHere is an example of how I used mock to test the navigation, menu, etc https://github.com/vasilty/work_log_db/blob/master/tests.py
Apiwat Phong
39 PointsApiwat Phong
39 PointsThank you for your suggestion, I would try it !