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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandelman
  • Date: 2012-06-22 12:39:57 UTC
  • mfrom: (1.1.57)
  • Revision ID: package-import@ubuntu.com-20120622123957-hbzwg84nt9rqwg8r
Tags: 2012.2~f2~20120621.14517-0ubuntu1
[ Chuck Short ]
* New upstream version.

[ Adam Gandelman ]
* debian/rules: Temporarily disable test suite while blocking
  tests are investigated. 
* debian/patches/kombu_tests_timeout.patch: Dropped.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#    License for the specific language governing permissions and limitations
16
16
#    under the License.
17
17
 
18
 
import json
19
 
 
20
18
import feedparser
21
19
from lxml import etree
22
20
import webob
24
22
from nova.api.openstack.compute import versions
25
23
from nova.api.openstack.compute import views
26
24
from nova.api.openstack import xmlutil
 
25
from nova.openstack.common import jsonutils
27
26
from nova import test
28
27
from nova.tests.api.openstack import common
29
28
from nova.tests.api.openstack import fakes
88
87
        res = req.get_response(fakes.wsgi_app())
89
88
        self.assertEqual(res.status_int, 200)
90
89
        self.assertEqual(res.content_type, "application/json")
91
 
        versions = json.loads(res.body)["versions"]
 
90
        versions = jsonutils.loads(res.body)["versions"]
92
91
        expected = [
93
92
            {
94
93
                "id": "v2.0",
117
116
        res = req.get_response(fakes.wsgi_app())
118
117
        self.assertEqual(res.status_int, 200)
119
118
        self.assertEqual(res.content_type, "application/json")
120
 
        version = json.loads(res.body)
 
119
        version = jsonutils.loads(res.body)
121
120
        expected = {
122
121
            "version": {
123
122
                "id": "v2.0",
161
160
        res = req.get_response(fakes.wsgi_app())
162
161
        self.assertEqual(res.status_int, 200)
163
162
        self.assertEqual(res.content_type, "application/json")
164
 
        version = json.loads(res.body)
 
163
        version = jsonutils.loads(res.body)
165
164
        expected = {
166
165
            "version": {
167
166
                "id": "v2.0",
347
346
            },
348
347
        ], }
349
348
 
350
 
        self.assertDictMatch(expected, json.loads(res.body))
 
349
        self.assertDictMatch(expected, jsonutils.loads(res.body))
351
350
 
352
351
    def test_multi_choice_image_xml(self):
353
352
        req = webob.Request.blank('/images/1')
417
416
            },
418
417
        ], }
419
418
 
420
 
        self.assertDictMatch(expected, json.loads(res.body))
 
419
        self.assertDictMatch(expected, jsonutils.loads(res.body))
421
420
 
422
421
 
423
422
class VersionsViewBuilderTests(test.TestCase):