I just had a question on how you write a test for the following function? Here is my test for the part that is covered, but I am not sure how I would change the test to cover the print statement and calling the get_employee_name
function again. Any help would be appreciated!
Here is my code to test the covered part:
DATA = {
"employee_name": "Brian Weber",
"minutes": 120,
"task_name": "Surfing",
"notes": "These are my notes.",
"date": "2016-12-25"
}
class WorkLogTests(unittest.TestCase):
def test_get_employee_name(self):
with mock.patch('builtins.input',
return_value=DATA["employee_name"]):
assert worklog.get_employee_name() == DATA["employee_name"]