SlipGURU Dipartimento di Informatica e Scienze dell'Informazione Università Degli Studi di Genova

tests Package

tests Package

Provides tests for KDVS. Three levels of testing are devised: unit tests (t), function tests (f), system tests (s). Currently, only t tests are implemented; some dummy f and s tests are also included for completion.

kdvs.tests.TEST_DATA_ROOT = '/home/grzegorz/Dropbox/KDVS2.0/kdvs/tests/test-data'

Default directory that contains read–only test data.

kdvs.tests.TEST_WRITE_ROOT = '/home/grzegorz/Dropbox/KDVS2.0/kdvs/tests/test-write'

Default writable directory to be used by tests that require writing.

exception kdvs.tests.TestError

Bases: exceptions.Exception

kdvs.tests.resolve_unittest()

Resolve unit testing module depending on the Python version and return it:

Raises :

TestError :

if respective unit testing module is not available

kdvs.tests.TEST_INVARIANTS = {'test_write_root': '/home/grzegorz/Dropbox/KDVS2.0/kdvs/tests/test-write', 'test_data_root': '/home/grzegorz/Dropbox/KDVS2.0/kdvs/tests/test-data'}

Constant values for all tests.

runTests Module

kdvs.tests.runTests.main()

utils Module

kdvs.tests.utils.test_dir_writable(directory)

Return True if directory is writable (checked by creating dummy temporary file in it), False otherwise

kdvs.tests.utils.count_lines(test_stream)

Return number of newlines (“\n”) in the stream.

kdvs.tests.utils.nostderr(*args, **kwds)

Context manager that consumes all output directed to sys.stderr without emitting it.

kdvs.tests.utils.nostdout(*args, **kwds)

Context manager that consumes all output directed to sys.stdout without emitting it.

kdvs.tests.utils.check_min_numpy_version(nmaj, nmin, nrel)

Return True if version of installed numpy is greater or equal than provided, False otherwise.

Table Of Contents