コード例 #1
0
def test_put_parameters(context):
    "requesting with PUT parameters"
    sl = SleepyHollow()
    response = sl.put(
        context.route_to('/status-200.json'),
        params={'name': 'Gabriel'}
    )

    # Let's test the types
    response.should.be.a(Response)
    response.status_code.should.be.an(int)
    response.text.should.be.a(unicode)
    response.content.should.be.a(str)

    response.json.should.equal({
        u'success': True,
        u'method': 'PUT',
        u'status': 200,
        u'name': u'Gabriel',
    })