Skip to content

Instantly share code, notes, and snippets.

Created February 4, 2016 06:41
Show Gist options
  • Save anonymous/82679495dbbbeab284cf to your computer and use it in GitHub Desktop.
Save anonymous/82679495dbbbeab284cf to your computer and use it in GitHub Desktop.
mocking pecan apps is annoying
def test_create_with_bad_handler(self):
self.controller_mock.health_monitor.create().side_effect = exceptions.APIException()
req_dict = {'type': constants.HEALTH_MONITOR_HTTP,
'delay': 1,
'timeout': 1,
'fall_threshold': 1,
'rise_threshold': 1}
self.post(self.hm_path, req_dict, status=500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment