~ubuntu-cloud-archive/ubuntu/precise/nova/trunk

« back to all changes in this revision

Viewing changes to nova/tests/api/openstack/v2/test_consoles.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandleman
  • Date: 2012-01-13 09:51:10 UTC
  • mfrom: (1.1.40)
  • Revision ID: package-import@ubuntu.com-20120113095110-ffd6163drcg77wez
Tags: 2012.1~e3~20120113.12049-0ubuntu1
[Chuck Short]
* New upstream version.
* debian/nova_sudoers, debian/nova-common.install, 
  Switch out to nova-rootwrap. (LP: #681774)
* Add "get-origsource-git" which allows developers to 
  generate a tarball from github, by doing:
  fakeroot debian/rules get-orig-source-git
* debian/debian/nova-objectstore.logrotate: Dont determine
  if we are running Debian or Ubuntu. (LP: #91379)

[Adam Gandleman]
* Removed python-nova.postinst, let dh_python2 generate instead since
  python-support is not a dependency. (LP: #907543)

Show diffs side-by-side

added added

removed removed

Lines of Context:
155
155
            pool = dict(console_type='fake_type',
156
156
                    public_hostname='fake_hostname')
157
157
            return dict(id=console_id, password='fake_password',
158
 
                    port='fake_port', pool=pool)
 
158
                    port='fake_port', pool=pool, instance_name='inst-0001')
159
159
 
160
160
        expected = {'console': {'id': 20,
161
161
                                'port': 'fake_port',
162
162
                                'host': 'fake_hostname',
163
163
                                'password': 'fake_password',
 
164
                                'instance_name': 'inst-0001',
164
165
                                'console_type': 'fake_type'}}
165
166
 
166
167
        self.stubs.Set(console.API, 'get_console', fake_get_console)
254
255
 
255
256
 
256
257
class TestConsolesXMLSerializer(test.TestCase):
257
 
 
258
 
    serializer = consoles.ConsoleXMLSerializer()
259
 
 
260
258
    def test_show(self):
261
259
        fixture = {'console': {'id': 20,
262
260
                               'password': 'fake_password',
264
262
                               'host': 'fake_hostname',
265
263
                               'console_type': 'fake_type'}}
266
264
 
267
 
        output = self.serializer.serialize(fixture, 'show')
 
265
        output = consoles.ConsoleTemplate().serialize(fixture)
268
266
        res_tree = etree.XML(output)
269
267
 
270
268
        self.assertEqual(res_tree.tag, 'console')
280
278
                                {'console': {'id': 11,
281
279
                                             'console_type': 'fake_type2'}}]}
282
280
 
283
 
        output = self.serializer.serialize(fixture, 'index')
 
281
        output = consoles.ConsolesTemplate().serialize(fixture)
284
282
        res_tree = etree.XML(output)
285
283
 
286
284
        self.assertEqual(res_tree.tag, 'consoles')