Exemplo n.º 1
0
def test_user_lookup_handler_missing(conn):
    values = {'format': 'json', 'client': 'app1key', 'user': '******'}
    builder = EnvironBuilder(method='POST', data=values)
    handler = UserLookupHandler(connect=provider(conn))
    resp = handler.handle(Request(builder.get_environ()))
    assert_equals('application/json; charset=UTF-8', resp.content_type)
    assert_equals('400 BAD REQUEST', resp.status)
    data = json.loads(resp.data)
    assert_equal('error', data['status'])
    assert_equal(6, data['error']['code'])
Exemplo n.º 2
0
def test_user_lookup_handler_missing(conn):
    values = {'format': 'json', 'client': 'app1key', 'user': '******'}
    builder = EnvironBuilder(method='POST', data=values)
    handler = UserLookupHandler(connect=provider(conn))
    resp = handler.handle(Request(builder.get_environ()))
    assert_equals('application/json; charset=UTF-8', resp.content_type)
    assert_equals('400 BAD REQUEST', resp.status)
    data = json.loads(resp.data)
    assert_equal('error', data['status'])
    assert_equal(6, data['error']['code'])
Exemplo n.º 3
0
def test_user_lookup_handler(conn):
    values = {'format': 'json', 'client': 'app1key', 'user': '******'}
    builder = EnvironBuilder(method='POST', data=values)
    handler = UserLookupHandler(connect=provider(conn))
    resp = handler.handle(Request(builder.get_environ()))
    assert_equals('application/json; charset=UTF-8', resp.content_type)
    assert_equals('200 OK', resp.status)
    data = json.loads(resp.data)
    assert_equal('ok', data['status'])
    assert_equal('user1key', data['user']['apikey'])
Exemplo n.º 4
0
def test_user_lookup_handler(conn):
    values = {'format': 'json', 'client': 'app1key', 'user': '******'}
    builder = EnvironBuilder(method='POST', data=values)
    handler = UserLookupHandler(connect=provider(conn))
    resp = handler.handle(Request(builder.get_environ()))
    assert_equals('application/json; charset=UTF-8', resp.content_type)
    assert_equals('200 OK', resp.status)
    data = json.loads(resp.data)
    assert_equal('ok', data['status'])
    assert_equal('user1key', data['user']['apikey'])