~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

Viewing changes to nova/tests/api/openstack/compute/test_server_actions.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, James Page
  • Date: 2013-03-20 12:59:22 UTC
  • mfrom: (1.1.69)
  • Revision ID: package-import@ubuntu.com-20130320125922-ohvfav96lemn9wlz
Tags: 1:2013.1~rc1-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/patches/avoid_setuptools_git_dependency.patch: Refreshed.
* debian/control: Clean up dependencies:
  - Dropped python-gflags no longer needed.
  - Dropped python-daemon no longer needed.
  - Dropped python-glance no longer needed.
  - Dropped python-lockfile no longer needed.
  - Dropped python-simplejson no longer needed.
  - Dropped python-tempita no longer needed.
  - Dropped python-xattr no longer needed.
  - Add sqlite3 required for the testsuite.

[ James Page ]
* d/watch: Update uversionmangle to deal with upstream versioning
  changes, remove tarballs.openstack.org. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2011 OpenStack LLC.
 
1
# Copyright 2011 OpenStack Foundation
2
2
# All Rights Reserved.
3
3
#
4
4
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
32
32
from nova.tests.api.openstack import fakes
33
33
from nova.tests.image import fake
34
34
from nova.tests import matchers
 
35
from nova.tests import utils
35
36
 
36
37
CONF = cfg.CONF
37
38
CONF.import_opt('password_length', 'nova.utils')
784
785
        image_service.create(None, original_image)
785
786
 
786
787
        def fake_block_device_mapping_get_all_by_instance(context, inst_id):
787
 
            class BDM(object):
788
 
                def __init__(self):
789
 
                    self.no_device = None
790
 
                    self.values = dict(volume_id=_fake_id('a'),
791
 
                                       virtual_name=None,
792
 
                                       volume_size=1,
793
 
                                       device_name='vda',
794
 
                                       snapshot_id=1,
795
 
                                       delete_on_termination=False)
796
 
 
797
 
                def __getattr__(self, name):
798
 
                    """Properly delegate dotted lookups."""
799
 
                    if name in self.__dict__['values']:
800
 
                        return self.values.get(name)
801
 
                    try:
802
 
                        return self.__dict__[name]
803
 
                    except KeyError:
804
 
                        raise AttributeError
805
 
 
806
 
                def __getitem__(self, key):
807
 
                    return self.values.get(key)
808
 
 
809
 
                def iteritems(self):
810
 
                    return self.values.iteritems()
811
 
 
812
 
            return [BDM()]
 
788
            return [dict(volume_id=_fake_id('a'),
 
789
                         virtual_name=None,
 
790
                         volume_size=1,
 
791
                         device_name='vda',
 
792
                         snapshot_id=1,
 
793
                         delete_on_termination=False,
 
794
                         no_device=None)]
813
795
 
814
796
        self.stubs.Set(db, 'block_device_mapping_get_all_by_instance',
815
797
                       fake_block_device_mapping_get_all_by_instance)
1165
1147
                          self.deserializer.deserialize,
1166
1148
                          serial_request,
1167
1149
                          'action')
 
1150
 
 
1151
    def test_corrupt_xml(self):
 
1152
        """Should throw a 400 error on corrupt xml."""
 
1153
        self.assertRaises(
 
1154
                exception.MalformedRequestBody,
 
1155
                self.deserializer.deserialize,
 
1156
                utils.killer_xml_body())