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

« back to all changes in this revision

Viewing changes to ironic/tests/db/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:
19
19
 
20
20
from ironic.common import exception
21
21
from ironic.common import utils as ironic_utils
22
 
from ironic.db import api as dbapi
23
 
 
24
22
from ironic.tests.db import base
25
23
from ironic.tests.db import utils
26
24
 
27
25
 
28
26
class DbChassisTestCase(base.DbTestCase):
29
27
 
30
 
    def setUp(self):
31
 
        super(DbChassisTestCase, self).setUp()
32
 
        self.dbapi = dbapi.get_instance()
33
 
 
34
28
    def _create_test_chassis(self, **kwargs):
35
29
        ch = utils.get_test_chassis(**kwargs)
36
30
        self.dbapi.create_chassis(ch)
37
31
        return ch
38
32
 
39
 
    def _create_test_node(self, **kwargs):
40
 
        node = utils.get_test_node(**kwargs)
41
 
        return self.dbapi.create_node(node)
42
 
 
43
33
    def test_get_chassis_list(self):
44
34
        uuids = []
45
35
        for i in range(1, 6):
95
85
 
96
86
    def test_destroy_chassis_with_nodes(self):
97
87
        ch = self._create_test_chassis()
98
 
        self._create_test_node(chassis_id=ch['id'])
 
88
        utils.create_test_node(chassis_id=ch['id'])
99
89
 
100
90
        self.assertRaises(exception.ChassisNotEmpty,
101
91
                          self.dbapi.destroy_chassis, ch['id'])