Ejemplo n.º 1
0
    def create_contest(self):
        """Create a new contest.

        return (int): contest id.

        """
        start_time = datetime.datetime.utcnow()
        stop_time = start_time + datetime.timedelta(1, 0, 0)
        self.contest_id = add_contest(
            name="testcontest" + str(self.rand),
            description="A test contest #%s." % self.rand,
            languages=LANGUAGES,
            allow_password_authentication="checked",
            start=start_time.strftime("%Y-%m-%d %H:%M:%S.%f"),
            stop=stop_time.strftime("%Y-%m-%d %H:%M:%S.%f"),
            timezone=get_system_timezone(),
            token_mode="finite",
            token_max_number="100",
            token_min_interval="0",
            token_gen_initial="100",
            token_gen_number="0",
            token_gen_interval="1",
            token_gen_max="100",
        )
        logger.info("Created contest %s.", self.contest_id)
        return self.contest_id
Ejemplo n.º 2
0
    def create_contest(self):
        """Create a new contest.

        return (int): contest id.

        """
        start_time = datetime.datetime.utcnow()
        stop_time = start_time + datetime.timedelta(1, 0, 0)
        self.contest_id = add_contest(
            name="testcontest" + str(self.rand),
            description="A test contest #%s." % self.rand,
            languages=list(ALL_LANGUAGES),
            allow_password_authentication="checked",
            start=start_time.strftime("%Y-%m-%d %H:%M:%S.%f"),
            stop=stop_time.strftime("%Y-%m-%d %H:%M:%S.%f"),
            timezone=get_system_timezone(),
            allow_user_tests="checked",
            token_mode="finite",
            token_max_number="100",
            token_min_interval="0",
            token_gen_initial="100",
            token_gen_number="0",
            token_gen_interval="1",
            token_gen_max="100",
        )
        logger.info("Created contest %s.", self.contest_id)
        return self.contest_id
Ejemplo n.º 3
0
    def create_contest(self):
        """Create a new contest.

        return (int): contest id.

        """
        start_time = datetime.datetime.utcnow()
        stop_time = start_time + datetime.timedelta(1, 0, 0)
        self.contest_id = self.framework.add_contest(
            name="testcontest_%s" % self.suffix,
            description="A test contest #%s." % self.suffix,
            languages=list(ALL_LANGUAGES),
            allow_password_authentication="checked",
            start=start_time.strftime("%Y-%m-%d %H:%M:%S.%f"),
            stop=stop_time.strftime("%Y-%m-%d %H:%M:%S.%f"),
            timezone=get_system_timezone(),
            allow_user_tests="checked",
            token_mode=TOKEN_MODE_FINITE,
            token_max_number="100",
            token_min_interval="0",
            token_gen_initial="100",
            token_gen_number="0",
            token_gen_interval="1",
            token_gen_max="100",
        )
        logger.info("Created contest %s.", self.contest_id)
        return self.contest_id
Ejemplo n.º 4
0
def create_contest():
    start_time = datetime.datetime.utcnow()
    stop_time = start_time + datetime.timedelta(1, 0, 0)
    contest_id = add_contest(
        name="testcontest1",
        description="A test contest #1.",
        languages=LANGUAGES,
        start=start_time.strftime("%Y-%m-%d %H:%M:%S.%f"),
        stop=stop_time.strftime("%Y-%m-%d %H:%M:%S.%f"),
        timezone=get_system_timezone(),
        token_mode="finite",
        token_max_number="100",
        token_min_interval="0",
        token_gen_initial="100",
        token_gen_number="0",
        token_gen_interval="1",
        token_gen_max="100",
    )

    info("Created contest %d." % contest_id)

    return contest_id
Ejemplo n.º 5
0
def create_contest():
    start_time = datetime.datetime.utcnow()
    stop_time = start_time + datetime.timedelta(1, 0, 0)
    contest_id = add_contest(
        name="testcontest1",
        description="A test contest #1.",
        languages=LANGUAGES,
        start=start_time.strftime("%Y-%m-%d %H:%M:%S.%f"),
        stop=stop_time.strftime("%Y-%m-%d %H:%M:%S.%f"),
        timezone=get_system_timezone(),
        token_mode="finite",
        token_max_number="100",
        token_min_interval="0",
        token_gen_initial="100",
        token_gen_number="0",
        token_gen_interval="1",
        token_gen_max="100",
    )

    info("Created contest %d." % contest_id)

    return contest_id