def test_sort_by_priority(mocked_print, mocked_input, mocked_requests_get, mocked_requests_post, mocked_requests_delete): with patch('builtins.open'): App().run() mocked_requests_post.assert_called() mocked_input.assert_called()
def test_exit(mocked_print, mocked_input): with patch('builtins.open'): App().run() mocked_print.assert_any_call('*** To Do List Login ***') mocked_print.assert_any_call('0:\tExit') mocked_print.assert_any_call('Bye!') mocked_input.assert_called()
def test_add_event(mocked_print, mocked_input, mocked_requests_get, mocked_requests_post): with patch('builtins.open'): App().run() mocked_requests_post.assert_called() mocked_input.assert_called() mocked_print.assert_any_call('Event added!')
def test_register_user_common_password(mocked_print, mocked_input, mocked_requests_get, mocked_requests_post): with patch('builtins.open'): App().run() mocked_requests_post.assert_called() mocked_input.assert_called() mocked_print.assert_any_call('Something went wrong')
def test_wrong_credentials(mocked_print, mocked_input, mocked_requests_get, mocked_requests_post): with patch('builtins.open'): App().run() mocked_print.assert_any_call('*** To Do List Login ***') mocked_requests_post.assert_called() mocked_input.assert_called() mocked_print.assert_any_call('Wrong Credentials!')
def test_remove_event(mocked_print, mocked_input, mocked_requests_get, mocked_requests_post, mocked_requests_delete): with patch('builtins.open'): App().run() mocked_requests_post.assert_called() mocked_input.assert_called() mocked_requests_delete.assert_called() mocked_print.assert_any_call('Event removed')
def test_logout_wrong(mocked_print, mocked_input, mocked_requests_get, mocked_requests_post): with patch('builtins.open'): App().run() mocked_requests_post.assert_called() mocked_input.assert_called() mocked_requests_get.assert_called_with( url='http://localhost:8000/api/v1/events', headers={ 'Authorization': 'Token 301ed42f7db4a71b682716f7b3e351a2dd10c459' }) mocked_print.assert_any_call('Log out failed')