def test_ping(rsession, args, token): url = iorio.format_url(args.host, args.port, 'ping') result = iorio.get_json(rsession, url, token) assert result.status_code == OK_STATUS body = parse(result.text) assert "pong" in body pong = body["pong"] assert isinstance(pong, str) assert len(pong) > 0
def test_can_get_own_stream(session, args, token, user): bucket = user stream = "stream2" url = iorio.format_url(args.host, args.port, 'streams', bucket, stream) result = iorio.get_json(session, url, token) assert result.status_code == OK_STATUS body = parse(result.text) assert isinstance(body, list) assert len(body) == 0
def create_user(session, args, token, username, password): url = iorio.format_url(args.host, args.port, 'users') req_body = dict(username=username, password=password) return iorio.post_data_json(session, url, req_body, token)
def test_get_session(session, args, token, username): url = iorio.format_url(args.host, args.port, 'sessions') result = iorio.get_json(session, url, token) assert result.status_code == OK_STATUS body = parse(result.text) assert_field(body, "username", username)
def list_buckets(session, args, token): url = iorio.format_url(args.host, args.port, 'buckets') result = iorio.get_json(session, url, token) body = parse(result.text) return result, body
def call_access_bucket(session, args, token, bucket, access, username, action): url = iorio.format_url(args.host, args.port, 'access', bucket) data = dict(permission=access, username=username, action=action) return post(session, token, url, data)