I'm currently testing my python code and have a question about raw_input. This is my function:
def answer():
ans = raw_input('enter yes or no')
if ans == 'yes':
print 'you entered yes'
return 'yes'
if ans == 'no':
some_value = raw_input('enter some value: ')
print 'you entered no'
return some_value
I'm testing the first if statement this way:
with mock.patch('__builtin__.raw_input', return_value= 'yes'):
assert answer() == 'yes'
But how do I check the no statement ? How do I make mock inside a mock ?