예제 #1
0
        def load_filtered_scoreboard_pages(l):
            """Load several pages of a filtered random scoreboard."""
            username = login(l)
            if not username:
                l.interrupt()
            simulate_loading_scoreboard_page(l)

            endpoint, call_label = get_valid_scoreboard_base_endpoint(l)
            l.client.get(
                endpoint + "/score_progressions",
                name=(call_label + "/score_progressions"),
            )
            initial_page_res = l.client.get(endpoint + "/scoreboard",
                                            name=(call_label +
                                                  "/scoreboard")).json()
            search_endpoint = endpoint + "/scoreboard?search=" + get_affiliation(
            )
            for i in range(0, random.randrange(1, 10)):
                p = random.randrange(1, initial_page_res["total_pages"] + 1)
                l.client.get(
                    search_endpoint + "&page=" + str(p),
                    name=(call_label + "/scoreboard?search=[q]&page=[p]"),
                )
            logout(l)
            release_user(username)
            l.interrupt()
예제 #2
0
def generate_user():
    """Generate a set of valid demographics for the given user type."""
    user_fields =  {
        'username': get_username(),
        'password': '******',
        'email': get_email(),
        'affiliation': get_affiliation(),
        'country': get_country_code(),
        'usertype': get_user_type(),
        'demo': get_demographics(),
    }
    return user_fields
예제 #3
0
def generate_user():
    """Generate a set of valid demographics for the given user type."""
    user_fields = {
        "username": get_username(),
        "password": "******",
        "email": get_email(),
        "affiliation": get_affiliation(),
        "country": get_country_code(),
        "usertype": get_user_type(),
        "demo": get_demographics(),
    }
    return user_fields