:orphan: :py:mod:`oioioi.evalmgr.tests.tests` ==================================== .. py:module:: oioioi.evalmgr.tests.tests Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.evalmgr.tests.tests.TestLocalJobs oioioi.evalmgr.tests.tests.SioworkersBackend oioioi.evalmgr.tests.tests.TestRemoteJobs oioioi.evalmgr.tests.tests.TestErrorBehavior oioioi.evalmgr.tests.tests.TestAsyncJobs oioioi.evalmgr.tests.tests.TestViews oioioi.evalmgr.tests.tests.AddHandlersController oioioi.evalmgr.tests.tests.TestEval Functions ~~~~~~~~~ .. autoapisummary:: oioioi.evalmgr.tests.tests.delay_environ_wrapper oioioi.evalmgr.tests.tests.hunting_handler oioioi.evalmgr.tests.tests.prepare_handler oioioi.evalmgr.tests.tests.rest_handler oioioi.evalmgr.tests.tests.upload_source oioioi.evalmgr.tests.tests.compile_source oioioi.evalmgr.tests.tests.upload_inout oioioi.evalmgr.tests.tests.run oioioi.evalmgr.tests.tests._uuid oioioi.evalmgr.tests.tests.police_handler oioioi.evalmgr.tests.tests.corrupted_police_handler oioioi.evalmgr.tests.tests.set_mood oioioi.evalmgr.tests.tests._call_transfer oioioi.evalmgr.tests.tests._resume oioioi.evalmgr.tests.tests._transfer Attributes ~~~~~~~~~~ .. autoapisummary:: oioioi.evalmgr.tests.tests.hunting oioioi.evalmgr.tests.tests.police_files .. py:function:: delay_environ_wrapper(*args, **kwargs) .. py:data:: hunting :annotation: = [['Prepare guns', 'oioioi.evalmgr.tests.tests.prepare_handler'], None, ['Rest',... .. py:exception:: HuntingException Bases: :py:obj:`Exception` Common base class for all non-exit exceptions. .. py:function:: hunting_handler(env, **kwargs) .. py:function:: prepare_handler(env, **kwargs) .. py:function:: rest_handler(env, **kwargs) .. py:class:: TestLocalJobs(methodName='runTest') Bases: :py:obj:`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. .. py:method:: test_evalmgr_job() .. py:method:: test_cascade_job() .. py:method:: test_multiple_jobs() .. py:function:: upload_source(env, **kwargs) .. py:function:: compile_source(env, **kwargs) .. py:function:: upload_inout(env, **kwargs) .. py:function:: run(env, **kwargs) .. py:class:: SioworkersBackend Bases: :py:obj:`object` .. py:method:: run_job(env) .. py:function:: _uuid() .. py:class:: TestRemoteJobs(methodName='runTest') Bases: :py:obj:`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. .. py:attribute:: base_dir .. py:attribute:: local_source_file .. py:attribute:: remote_source_file .. py:attribute:: local_wrong_source_file .. py:attribute:: remote_wrong_source_file .. py:attribute:: binary_file .. py:attribute:: local_in_file .. py:attribute:: remote_in_file .. py:attribute:: local_out_file .. py:attribute:: remote_out_file .. py:attribute:: evaluation_recipe :annotation: = [['upload source', 'oioioi.evalmgr.tests.tests.upload_source'], ['compile source',... .. py:attribute:: evaluation_env .. py:method:: tearDown() Hook method for deconstructing the test fixture after testing it. .. py:method:: _run_with_dummy_sioworkers(testfn) .. py:method:: test_full_source_file_evaluation_with_dummy_sioworkers() .. py:method:: test_multiple_source_file_evaluation_with_dummy_sioworkers() .. py:method:: test_full_source_file_evaluation() .. py:method:: test_multiple_source_file_evaluation() .. py:data:: police_files .. py:exception:: SuspectNotFoundException Bases: :py:obj:`Exception` Common base class for all non-exit exceptions. .. py:function:: police_handler(env, **kwargs) .. py:function:: corrupted_police_handler(env, **kwargs) .. py:function:: set_mood(env, **kwargs) .. py:class:: TestErrorBehavior(methodName='runTest') Bases: :py:obj:`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. .. py:attribute:: error_handlers :annotation: = [['Call police', 'oioioi.evalmgr.tests.tests.police_handler'], None] .. py:attribute:: arrest :annotation: = [['Call police', 'oioioi.evalmgr.tests.tests.police_handler']] .. py:attribute:: corrupted_error_handler :annotation: = [['Call police', 'oioioi.evalmgr.tests.tests.corrupted_police_handler']] .. py:method:: test_error_behavior() .. py:class:: TestAsyncJobs(methodName='runTest') Bases: :py:obj:`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. .. py:attribute:: transferred_environs :annotation: = [] .. py:method:: _prepare() .. py:method:: test_transfer_job() .. py:method:: test_environ_save() .. py:method:: test_transfer_fail() .. py:method:: test_job_resumed_twice() .. py:method:: test_saved_environ_id() .. py:function:: _call_transfer(environ) .. py:function:: _resume(saved_environ, environ) .. py:function:: _transfer(environ, transfer_magic=None) .. py:class:: TestViews(methodName='runTest') Bases: :py:obj:`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. .. py:attribute:: fixtures :annotation: = ['test_users', 'test_contest', 'test_full_package', 'test_problem_instance', 'test_submission'] .. py:method:: _get_admin_site() .. py:method:: assertStateCountEqual(state_str, count, show_response=None) Asserts that the number of the submits with given state (``state_str``) that appear on the admin site is ``count``. .. py:method:: assertNotPresent(state_strs) Asserts that none of the ``state_strs`` is present on the admin page .. py:method:: test_admin_view() Test if a submit shows on the list properly. .. py:class:: AddHandlersController(contest) Bases: :py:obj:`oioioi.programs.controllers.ProgrammingContestController` Contains the contest logic and rules. This is the computerized implementation of the contest's official rules. .. py:class:: TestEval(methodName='runTest') Bases: :py:obj:`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. .. py:attribute:: fixtures :annotation: = ['test_users', 'test_contest', 'test_full_package', 'test_problem_instance', 'test_submission'] .. py:method:: test_add_handlers() Test if the proper handlers are added to the recipe. .. py:method:: test_revoke() Test if a submit revokes properly.