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

« back to all changes in this revision

Viewing changes to ironic/tests/db/sqlalchemy/test_types.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2015-03-30 11:14:57 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20150330111457-kr4ju3guf22m4vbz
Tags: 2015.1~b3-0ubuntu1
* New upstream release.
  + d/control: 
    - Align with upstream dependencies.
    - Add dh-python to build-dependencies.
    - Add psmisc as a dependency. (LP: #1358820)
  + d/p/fix-requirements.patch: Rediffed.
  + d/ironic-conductor.init.in: Fixed typos in LSB headers,
    thanks to JJ Asghar. (LP: #1429962)

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
"""Tests for custom SQLAlchemy types via Ironic DB."""
14
14
 
15
15
from oslo_db import exception as db_exc
 
16
from oslo_utils import uuidutils
16
17
 
17
 
from ironic.common import utils as ironic_utils
18
18
import ironic.db.sqlalchemy.api as sa_api
19
19
from ironic.db.sqlalchemy import models
20
20
from ironic.tests.db import base
27
27
 
28
28
    def test_JSONEncodedDict_default_value(self):
29
29
        # Create chassis w/o extra specified.
30
 
        ch1_id = ironic_utils.generate_uuid()
 
30
        ch1_id = uuidutils.generate_uuid()
31
31
        self.dbapi.create_chassis({'uuid': ch1_id})
32
32
        # Get chassis manually to test SA types in isolation from UOM.
33
33
        ch1 = sa_api.model_query(models.Chassis).filter_by(uuid=ch1_id).one()
34
34
        self.assertEqual({}, ch1.extra)
35
35
 
36
36
        # Create chassis with extra specified.
37
 
        ch2_id = ironic_utils.generate_uuid()
 
37
        ch2_id = uuidutils.generate_uuid()
38
38
        extra = {'foo1': 'test', 'foo2': 'other extra'}
39
39
        self.dbapi.create_chassis({'uuid': ch2_id, 'extra': extra})
40
40
        # Get chassis manually to test SA types in isolation from UOM.