def test_authentication_controller_raises_exception_if_user_does_not_exist(self, mock_user_repository):
     with self.assertRaises(AuthenticationException):
         authentication_controller = Authentication()
         mock_user_repository.return_value = None
         authentication_controller.look_up_user('*****@*****.**')
 def test_authentication_controller_returns_user_from_lookup(self, mock_user_repository):
     authentication_controller = Authentication()
     mock_user = MagicMock()
     mock_user_repository.return_value = mock_user 
     self.assertEqual(authentication_controller.look_up_user('*****@*****.**'), mock_user)
 def test_authentication_controller_delegates_to_user_repository(self, mock_user_repository):
     authentication_controller = Authentication()
     authentication_controller.look_up_user('*****@*****.**')
     mock_user_repository.assert_called_with('*****@*****.**')