[nailgun] Get a rid of json.loads/json.dumps from tests

Bug #1304967 reported by Ivan Kolodyazhny
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Low
Unassigned

Bug Description

Almost all tests for REST API uses following code structure:
resp = self.app.post(
            reverse('TestHandler'),
            json.dumps({'test': 'test'}),
            headers=self.default_headers,
            expect_errors=True)
self.assertEquals(json.loads(resp.body), {'response': 'test'})

Calling json.loads/json.dumps should be moved to base class to make more clear and DRY code.

Changed in fuel:
importance: Undecided → Low
milestone: none → 5.0
status: New → Confirmed
Dmitry Pyzhov (dpyzhov)
Changed in fuel:
milestone: 5.0 → 5.1
Dmitry Ilyin (idv1985)
summary: - Get a rid of json.loads/json.dumps from tests
+ [nailgun] Get a rid of json.loads/json.dumps from tests
Changed in fuel:
milestone: 5.1 → 6.0
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Ivan Kliuk (ivankliuk)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

Fix proposed to branch: master
Review: https://review.openstack.org/125413

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/125413
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=54c80d9b96448cf24570499e065b7bc7ffdf3023
Submitter: Jenkins
Branch: master

commit 54c80d9b96448cf24570499e065b7bc7ffdf3023
Author: Ivan Kliuk <email address hidden>
Date: Wed Oct 1 06:32:44 2014 +0300

    Refactoring JSON serialization of response object

        Swapping DRY code jsonutils.loads(webob.TestResponse.body) with
        webob.TestResponse.json_body property.

    Change-Id: I2f4e0cd3f1f8abc209e19491287f3630b1c4e80d
    Closes-Bug: #1304967

Changed in fuel:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.