oioioi.problems.tests.utilities¶
Module Contents¶
Classes¶
Defines rules for handling specific problem. |
|
A class which manages problem packages. |
|
Contains the contest logic and rules. |
Functions¶
|
|
|
- class oioioi.problems.tests.utilities.TestProblemController(problem)[source]¶
Bases:
oioioi.problems.controllers.ProblemControllerDefines rules for handling specific problem.
Every method should:
be called from contest controller
or be specific for problems that this controller controls
Please note that a global problem instance exists for each problem. That problem instance has no contest (
contestisNone), so methods can’t be overridden by a contest controller which means they behave in a default way.- abstract fill_evaluation_environ(environ, submission, **kwargs)[source]¶
Fills a minimal environment with evaluation receipt and other values required by the evaluation machinery.
Passed
environshould already contain entries for the actiual data to be judged (for example the source file to evaluate).Details on which keys need to be present should be specified by particular subclasses.
As the result,
environwill be filled at least with a suitable evaluationrecipe.
- exception oioioi.problems.tests.utilities.DummyPackageException[source]¶
Bases:
ExceptionCommon base class for all non-exit exceptions.
- class oioioi.problems.tests.utilities.DummyPackageBackend[source]¶
Bases:
oioioi.problems.package.ProblemPackageBackendA class which manages problem packages.
The main functionality is extracting archives with problem statements, data, model solutions etc. and building
Probleminstances.- identify(path, original_filename=None)[source]¶
Checks if the backend is suitable for processing the specified problem package.
- Parameters
path – a path to the processed problem package
original_filename – the name of the package specified by the
uploading user.
Returns
Trueif the backend can handle the specified problem package file.
- get_short_name(path, original_filename=None)[source]¶
Returns the problem’s short name.
- Parameters
path – a path to the processed problem package
original_filename – the name of the package specified by the
uploading user.
- unpack(env)[source]¶
Processes a package, creating a new
Problemor updating an existing one.This function will be called either from
unpackmgr_job()(Celery task) or fromsimple_unpack()(e.g. when a problem is added from a command line).- Used
envkeys: package_id: an id of theProblemPackageinstance with the package file to unpack.- Produced
envkeys: problem_id: an id of theProbleminstance representing the created or modified problem.
- Used
- class oioioi.problems.tests.utilities.DummySource[source]¶
Bases:
oioioi.problems.problem_sources.UploadedPackageSource- create_env(*args, **kwargs)[source]¶
Creates an environment which will be later passed to
unpackmgr_job().
- class oioioi.problems.tests.utilities.DummyContestController(contest)[source]¶
Bases:
oioioi.programs.controllers.ProgrammingContestControllerContains the contest logic and rules.
This is the computerized implementation of the contest’s official rules.