Beispiel #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
Beispiel #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
Beispiel #3
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.",
        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_initial="100",
        token_max="100",
        token_total="100",
        token_min_interval="0",
        token_gen_time="0",
        token_gen_number="0",
    )

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

    return contest_id
Beispiel #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.",
        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_initial="100",
        token_max="100",
        token_total="100",
        token_min_interval="0",
        token_gen_time="0",
        token_gen_number="0",
        )

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

    return contest_id
Beispiel #5
0
def create_contest():
    info("Creating contest.")
    start_time = datetime.datetime.now()
    end_time = start_time + datetime.timedelta(1, 0, 0)
    contest_id = add_contest(
        name="testcontest1",
        description="A test contest #1.",
        start=start_time.strftime("%d/%m/%Y %H:%M:%S"),
        end=end_time.strftime("%d/%m/%Y %H:%M:%S"),
        token_initial="100",
        #token_max="",
        #token_total="",
        #token_min_interval="",
        #token_gen_time="",
        #token_gen_number="",
        )

    start_service("ScoringService", contest=contest_id)
    start_service("EvaluationService", contest=contest_id)
    start_server("ContestWebServer", contest=contest_id)

    return contest_id
Beispiel #6
0
def create_contest():
    start_time = datetime.datetime.utcnow()
    stop_time = start_time + datetime.timedelta(1, 0, 0)
    contest_id = add_contest(
        name="testcontest" + str(rand),
        description="A test contest #%s." % rand,
        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
Beispiel #7
0
def create_contest():
    info("Creating 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.",
        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_initial="100",
        token_max="100",
        token_total="100",
        token_min_interval="0",
        token_gen_time="0",
        token_gen_number="0",
        )

    start_service("ScoringService", contest=contest_id)
    start_service("EvaluationService", contest=contest_id)
    start_server("ContestWebServer", contest=contest_id)

    return contest_id
Beispiel #8
0
def create_contest():
    info("Creating 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.",
        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_initial="100",
        token_max="100",
        token_total="100",
        token_min_interval="0",
        token_gen_time="0",
        token_gen_number="0",
    )

    start_service("ScoringService", contest=contest_id)
    start_service("EvaluationService", contest=contest_id)
    start_server("ContestWebServer", contest=contest_id)

    return contest_id