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

« back to all changes in this revision

Viewing changes to ironic/tests/objects/test_chassis.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-01-05 12:21:37 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20150105122137-171bqrdpcxqipunk
Tags: 2015.1~b1-0ubuntu1
* New upstream beta release:
  - d/control: Align version requirements with upstream release.
* d/watch: Update uversionmangle to deal with kilo beta versioning
  changes.
* d/control: Bumped Standards-Version to 3.9.6, no changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
from ironic.common import exception
20
20
from ironic.common import utils as ironic_utils
21
 
from ironic.db import api as db_api
22
21
from ironic import objects
23
 
 
24
22
from ironic.tests.db import base
25
23
from ironic.tests.db import utils
26
24
 
30
28
    def setUp(self):
31
29
        super(TestChassisObject, self).setUp()
32
30
        self.fake_chassis = utils.get_test_chassis()
33
 
        self.dbapi = db_api.get_instance()
34
31
 
35
32
    def test_get_by_id(self):
36
33
        chassis_id = self.fake_chassis['id']
82
79
                   dict(self.fake_chassis, uuid=new_uuid)]
83
80
        expected = [mock.call(uuid), mock.call(uuid)]
84
81
        with mock.patch.object(self.dbapi, 'get_chassis_by_uuid',
85
 
                               side_effect=returns, autospec=True) \
86
 
                as mock_get_chassis:
 
82
                               side_effect=returns,
 
83
                               autospec=True) as mock_get_chassis:
87
84
            c = objects.Chassis.get_by_uuid(self.context, uuid)
88
85
            self.assertEqual(uuid, c.uuid)
89
86
            c.refresh()