oioioi.sinolpack.tests

Module Contents

Classes

TestSinolPackageIdentify

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

TestSinolPackage

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

TestSinolPackageInContest

A class whose instances are single test cases.

TestSinolPackageCreator

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

TestJudging

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

TestLimits

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

Functions

Attributes

oioioi.sinolpack.tests.get_test_filename(name)[source]
oioioi.sinolpack.tests.BOTH_CONFIGURATIONS = %test_both_configurations[source]
oioioi.sinolpack.tests.use_makefiles(fn)[source]
oioioi.sinolpack.tests.no_makefiles(fn)[source]
oioioi.sinolpack.tests.enable_both_unpack_configurations(cls)[source]
oioioi.sinolpack.tests.both_configurations(fn)[source]
class oioioi.sinolpack.tests.TestSinolPackageIdentify(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_identify_zip()[source]
test_identify_tgz()[source]
class oioioi.sinolpack.tests.TestSinolPackage(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase, oioioi.filetracker.tests.TestStreamingMixin

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'][source]
test_title_in_config_yml()[source]
test_single_file_replacement()[source]
test_title_translations_in_config_yml()[source]
test_title_from_doc()[source]
test_latin2_title_from_doc()[source]
test_utf8_title_from_doc()[source]
test_utf8_title_from_config()[source]
test_memory_limit_from_doc()[source]
test_attachments()[source]
test_attachments_no_directory()[source]
test_attachments_empty_directory()[source]
test_attachments_reupload_same_attachments()[source]
test_attachments_reupload_no_attachments()[source]
test_assign_points_from_file()[source]
test_assign_global_time_limit_from_file()[source]
test_assign_time_limits_for_groups_from_file()[source]
test_assign_time_limits_for_groups_nonexistent()[source]
test_assign_time_limits_for_different_levels()[source]
test_assign_points_nonexistent()[source]
test_assign_points_not_exhaustive()[source]
test_huge_unpack_update()[source]
_check_no_ingen_package(problem, doc=True)[source]
test_no_ingen_package()[source]
_check_full_package(problem, doc=True)[source]
test_full_unpack_update()[source]
_check_interactive_package(problem)[source]
test_interactive_task()[source]
_add_problem_with_author(filename, author, nothrow=False)[source]
test_restrict_html()[source]
test_overriden_limits_with_reupload()[source]
class oioioi.sinolpack.tests.TestSinolPackageInContest(methodName='runTest')[source]

Bases: django.test.TransactionTestCase, oioioi.filetracker.tests.TestStreamingMixin

A class whose instances are single test cases.

By default, the test code itself should be placed in a method named ‘runTest’.

If the fixture may be used for many test cases, create as many test methods as are needed. When instantiating such a TestCase subclass, specify in the constructor arguments the name of the test method that the instance is to execute.

Test authors should subclass TestCase for their own tests. Construction and deconstruction of the test’s environment (‘fixture’) can be implemented by overriding the ‘setUp’ and ‘tearDown’ methods respectively.

If it is necessary to override the __init__ method, the base class __init__ method must always be called. It is important that subclasses should not change the signature of their __init__ method, since instances of the classes are instantiated automatically by parts of the framework in order to be run.

When subclassing TestCase, you can set these attributes: * failureException: determines which exception will be raised when

the instance’s assertion methods fail; test methods raising this exception will be deemed to have ‘failed’ rather than ‘errored’.

  • longMessage: determines whether long messages (including repr of

    objects used in assert methods) will be printed on failure in addition to any explicit message passed.

  • maxDiff: sets the maximum length of a diff in failure messages

    by assert methods using difflib. It is looked up as an instance attribute so can be configured by individual tests if required.

fixtures = ['test_users', 'test_contest'][source]
test_upload_and_download_package()[source]
test_inwer_failure_package()[source]
class oioioi.sinolpack.tests.TestSinolPackageCreator(methodName='runTest')[source]

Bases: oioioi.base.tests.TestCase, oioioi.filetracker.tests.TestStreamingMixin

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_full_package', 'test_problem_instance_with_no_contest'][source]
test_sinol_package_creator()[source]
class oioioi.sinolpack.tests.TestJudging(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'][source]
test_judging()[source]
class oioioi.sinolpack.tests.TestLimits(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'][source]
upload_package()[source]
test_time_limit()[source]
test_memory_limit()[source]