aeidon.TestCase

Source: aeidon/unittest.py

Anchestors: builtins.object

class aeidon.TestCase

Base class for unit test cases.

Unit tests are designed to be run with py.test, nose or something compatible. Tests should use plain assert statements to allow multiple different tools to be used to run the tests.

Methods

TestCase.assert_raises(exception, function, *args, **kwargs)

Assert that calling function raises exception.

TestCase.get_sample_text(format, name=None)

Return sample text for subtitle file format.

name can be specified if different from format.name.lower(). This is useful for variants of a format, e.g. “subrip-extended”.

TestCase.new_microdvd_file()

Return path to a new temporary MicroDVD file.

TestCase.new_project()

Return a new project with both main and translation files.

TestCase.new_subrip_file()

Return path to a new temporary SubRip file.

TestCase.new_temp_file(format, name=None)

Return path to a new temporary subtitle file.

TestCase.setUp()

Compatibility alias for setup_method().

TestCase.setup_method(method)

Set state for executing tests in method.

TestCase.tearDown()

Compatibility alias for teardown_method().

TestCase.teardown_method(method)

Remove state set for executing tests in method.

TestCase.test___init__()

Make sure that setup_method() is always run.