~ubuntu-branches/ubuntu/wily/heat/wily

« back to all changes in this revision

Viewing changes to heat/tests/test_glance_client.py

  • Committer: Package Import Robot
  • Author(s): Corey Bryant, Corey Bryant, James Page
  • Date: 2015-07-07 17:06:19 UTC
  • mfrom: (1.1.26) (45.1.1 vivid-proposed)
  • Revision ID: package-import@ubuntu.com-20150707170619-hra2dbjpfofpou4s
Tags: 1:5.0.0~b1-0ubuntu1
[ Corey Bryant ]
* New upstream milestone for OpenStack Liberty:
  - d/control: Align (build-)depends with upstream.
  - d/p/fix-requirements.patch: Rebased.
  - d/p/sudoers_patch.patch: Rebased.

[ James Page ]
* d/s/options: Ignore any removal of egg-info data during package clean.
* d/control: Drop MySQL and PostgreSQL related BD's, not required for unit
  testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
        self.glance_client.images.list.side_effect = ([self.my_image], [])
49
49
        self.assertEqual(img_id, self.glance_plugin.get_image_id(img_id))
50
50
        self.assertEqual(img_id, self.glance_plugin.get_image_id(img_name))
51
 
        self.assertRaises(exception.ImageNotFound,
 
51
        self.assertRaises(exception.EntityNotFound,
52
52
                          self.glance_plugin.get_image_id, 'noimage')
53
53
 
54
54
        calls = [mock.call(filters={'name': img_name}),
93
93
            glance_exceptions.HTTPNotFound()]
94
94
        self.glance_client.images.list.return_value = []
95
95
 
96
 
        self.assertRaises(exception.ImageNotFound,
 
96
        self.assertRaises(exception.EntityNotFound,
97
97
                          self.glance_plugin.get_image_id, img_name)
98
98
        self.glance_client.images.get.assert_called_once_with(img_name)
99
99
        self.glance_client.images.list.assert_called_once_with(
127
127
        self.assertTrue(self.constraint.validate("foo", self.ctx))
128
128
 
129
129
    def test_validation_error(self):
130
 
        self.mock_get_image.side_effect = exception.ImageNotFound(
131
 
            image_name='bar')
 
130
        self.mock_get_image.side_effect = exception.EntityNotFound(
 
131
            entity='Image', name='bar')
132
132
        self.assertFalse(self.constraint.validate("bar", self.ctx))