

def test_simple_json_response(self):
    data = {
        'a': 1,
    }
    app = flask.Flask(__name__)
    with app.test_request_context(method='GET', content_type='application/json', headers={
        'Accept': '*/*',
    }):

        @api(json)
        def view_method():
            return data
        (response, status_code, headers) = view_method()
    self.assertEquals(loads(response.data), data)
    self.assertEquals(response.mimetype, 'application/json')
    self.assertEquals(status_code, 200)

dataset/ETHPy150Open keenbrowne/flask-pbj/tests.py TestJson.test_simple_json_response/original