oioioi.evalmgr.tests.tests

Module Contents

Classes

TestLocalJobs

Similar to TransactionTestCase, but use transaction.atomic() to achieve

SioworkersBackend

TestRemoteJobs

Similar to TransactionTestCase, but use transaction.atomic() to achieve

TestErrorBehavior

Similar to TransactionTestCase, but use transaction.atomic() to achieve

TestAsyncJobs

Similar to TransactionTestCase, but use transaction.atomic() to achieve

TestViews

Similar to TransactionTestCase, but use transaction.atomic() to achieve

AddHandlersController

Contains the contest logic and rules.

TestEval

Similar to TransactionTestCase, but use transaction.atomic() to achieve

Functions

delay_environ_wrapper(*args, **kwargs)

hunting_handler(env, **kwargs)

prepare_handler(env, **kwargs)

rest_handler(env, **kwargs)

upload_source(env, **kwargs)

compile_source(env, **kwargs)

upload_inout(env, **kwargs)

run(env, **kwargs)

_uuid()

police_handler(env, **kwargs)

corrupted_police_handler(env, **kwargs)

set_mood(env, **kwargs)

_call_transfer(environ)

_resume(saved_environ, environ)

_transfer(environ[, transfer_magic])

Attributes

oioioi.evalmgr.tests.tests.delay_environ_wrapper(*args, **kwargs)[source]
oioioi.evalmgr.tests.tests.hunting = [['Prepare guns', 'oioioi.evalmgr.tests.tests.prepare_handler'], None, ['Rest',...[source]
exception oioioi.evalmgr.tests.tests.HuntingException[source]

Bases: Exception

Common base class for all non-exit exceptions.

oioioi.evalmgr.tests.tests.hunting_handler(env, **kwargs)[source]
oioioi.evalmgr.tests.tests.prepare_handler(env, **kwargs)[source]
oioioi.evalmgr.tests.tests.rest_handler(env, **kwargs)[source]
class oioioi.evalmgr.tests.tests.TestLocalJobs(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase

Similar to TransactionTestCase, but use transaction.atomic() to achieve test isolation.

In most situations, TestCase should be preferred to TransactionTestCase as it allows faster execution. However, there are some situations where using TransactionTestCase might be necessary (e.g. testing some transactional behavior).

On database backends with no transaction support, TestCase behaves as TransactionTestCase.

test_evalmgr_job()[source]
test_cascade_job()[source]
test_multiple_jobs()[source]
oioioi.evalmgr.tests.tests.upload_source(env, **kwargs)[source]
oioioi.evalmgr.tests.tests.compile_source(env, **kwargs)[source]
oioioi.evalmgr.tests.tests.upload_inout(env, **kwargs)[source]
oioioi.evalmgr.tests.tests.run(env, **kwargs)[source]
class oioioi.evalmgr.tests.tests.SioworkersBackend[source]

Bases: object

run_job(env)[source]
oioioi.evalmgr.tests.tests._uuid()[source]
class oioioi.evalmgr.tests.tests.TestRemoteJobs(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase

Similar to TransactionTestCase, but use transaction.atomic() to achieve test isolation.

In most situations, TestCase should be preferred to TransactionTestCase as it allows faster execution. However, there are some situations where using TransactionTestCase might be necessary (e.g. testing some transactional behavior).

On database backends with no transaction support, TestCase behaves as TransactionTestCase.

base_dir[source]
local_source_file[source]
remote_source_file[source]
local_wrong_source_file[source]
remote_wrong_source_file[source]
binary_file[source]
local_in_file[source]
remote_in_file[source]
local_out_file[source]
remote_out_file[source]
evaluation_recipe = [['upload source', 'oioioi.evalmgr.tests.tests.upload_source'], ['compile source',...[source]
evaluation_env[source]
tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

_run_with_dummy_sioworkers(testfn)[source]
test_full_source_file_evaluation_with_dummy_sioworkers()[source]
test_multiple_source_file_evaluation_with_dummy_sioworkers()[source]
test_full_source_file_evaluation()[source]
test_multiple_source_file_evaluation()[source]
oioioi.evalmgr.tests.tests.police_files[source]
exception oioioi.evalmgr.tests.tests.SuspectNotFoundException[source]

Bases: Exception

Common base class for all non-exit exceptions.

oioioi.evalmgr.tests.tests.police_handler(env, **kwargs)[source]
oioioi.evalmgr.tests.tests.corrupted_police_handler(env, **kwargs)[source]
oioioi.evalmgr.tests.tests.set_mood(env, **kwargs)[source]
class oioioi.evalmgr.tests.tests.TestErrorBehavior(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase

Similar to TransactionTestCase, but use transaction.atomic() to achieve test isolation.

In most situations, TestCase should be preferred to TransactionTestCase as it allows faster execution. However, there are some situations where using TransactionTestCase might be necessary (e.g. testing some transactional behavior).

On database backends with no transaction support, TestCase behaves as TransactionTestCase.

error_handlers = [['Call police', 'oioioi.evalmgr.tests.tests.police_handler'], None][source]
arrest = [['Call police', 'oioioi.evalmgr.tests.tests.police_handler']][source]
corrupted_error_handler = [['Call police', 'oioioi.evalmgr.tests.tests.corrupted_police_handler']][source]
test_error_behavior()[source]
class oioioi.evalmgr.tests.tests.TestAsyncJobs(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase

Similar to TransactionTestCase, but use transaction.atomic() to achieve test isolation.

In most situations, TestCase should be preferred to TransactionTestCase as it allows faster execution. However, there are some situations where using TransactionTestCase might be necessary (e.g. testing some transactional behavior).

On database backends with no transaction support, TestCase behaves as TransactionTestCase.

transferred_environs = [][source]
_prepare()[source]
test_transfer_job()[source]
test_environ_save()[source]
test_transfer_fail()[source]
test_job_resumed_twice()[source]
test_saved_environ_id()[source]
oioioi.evalmgr.tests.tests._call_transfer(environ)[source]
oioioi.evalmgr.tests.tests._resume(saved_environ, environ)[source]
oioioi.evalmgr.tests.tests._transfer(environ, transfer_magic=None)[source]
class oioioi.evalmgr.tests.tests.TestViews(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase

Similar to TransactionTestCase, but use transaction.atomic() to achieve test isolation.

In most situations, TestCase should be preferred to TransactionTestCase as it allows faster execution. However, there are some situations where using TransactionTestCase might be necessary (e.g. testing some transactional behavior).

On database backends with no transaction support, TestCase behaves as TransactionTestCase.

fixtures = ['test_users', 'test_contest', 'test_full_package', 'test_problem_instance', 'test_submission'][source]
_get_admin_site()[source]
assertStateCountEqual(state_str, count, show_response=None)[source]

Asserts that the number of the submits with given state (state_str) that appear on the admin site is count.

assertNotPresent(state_strs)[source]

Asserts that none of the state_strs is present on the admin page

test_admin_view()[source]

Test if a submit shows on the list properly.

class oioioi.evalmgr.tests.tests.AddHandlersController(contest)[source]

Bases: oioioi.programs.controllers.ProgrammingContestController

Contains the contest logic and rules.

This is the computerized implementation of the contest’s official rules.

class oioioi.evalmgr.tests.tests.TestEval(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase

Similar to TransactionTestCase, but use transaction.atomic() to achieve test isolation.

In most situations, TestCase should be preferred to TransactionTestCase as it allows faster execution. However, there are some situations where using TransactionTestCase might be necessary (e.g. testing some transactional behavior).

On database backends with no transaction support, TestCase behaves as TransactionTestCase.

fixtures = ['test_users', 'test_contest', 'test_full_package', 'test_problem_instance', 'test_submission'][source]
test_add_handlers()[source]

Test if the proper handlers are added to the recipe.

test_revoke()[source]

Test if a submit revokes properly.