~ubuntu-branches/ubuntu/vivid/ironic/vivid-updates

« back to all changes in this revision

Viewing changes to ironic/tests/api/test_hooks.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman, Adam Gandelman, James Page
  • Date: 2014-04-04 11:54:02 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20140404115402-wz51btzqxomdizv0
Tags: 2014.1~rc1-0ubuntu1
[ Adam Gandelman ]
* debian/ironic-common.postinst: Fix syntax preventing postinst
  from running.
* debian/ironic-api.install: Create missing .install, install
  ironic-api to /usr/bin/ironic-api.
* debian/patches/set_logdir.patch: Set log_dir to /var/log/ironic/ in
  sample config, causing both daemons to log to respective files there.
* debian/{rules, ironic-common.install}: Install ironic.conf.sample
  as /etc/ironic/ironic.conf.
* Fail build if test suite fails, limit testing concurrency to 1.
* debian/control: Add missing alembic, python-lockfile dependencies.

[ James Page ]
* d/control: Add Vcs-* fields for ubuntu-server-dev branches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
        actual_msg = json.loads(response.json['error_message'])['faultstring']
75
75
        self.assertEqual(msg, actual_msg)
76
76
 
77
 
    def test_hook_server_debug_on(self):
 
77
    def test_hook_server_debug_on_serverfault(self):
78
78
        cfg.CONF.set_override('debug', True)
79
79
        self.root_convert_mock.side_effect = Exception(self.MSG_WITH_TRACE)
80
80
 
82
82
 
83
83
        actual_msg = json.loads(
84
84
            response.json['error_message'])['faultstring']
 
85
        self.assertEqual(self.MSG_WITHOUT_TRACE, actual_msg)
 
86
 
 
87
    def test_hook_server_debug_on_clientfault(self):
 
88
        cfg.CONF.set_override('debug', True)
 
89
        client_error = Exception(self.MSG_WITH_TRACE)
 
90
        client_error.code = 400
 
91
        self.root_convert_mock.side_effect = client_error
 
92
 
 
93
        response = self.get_json('/', path_prefix='', expect_errors=True)
 
94
 
 
95
        actual_msg = json.loads(
 
96
            response.json['error_message'])['faultstring']
85
97
        self.assertEqual(self.MSG_WITH_TRACE, actual_msg)