astro.test package

Subpackages

Submodules

astro.test.connection_test module

class astro.test.connection_test.TestNetworkConnectionToDatabase(methodName='runTest')

Bases: unittest.case.TestCase

setUp()
test_dispatcher_connection()
test_domain()
test_node_connection()
test_oracle_connection()
test_oracle_dispatchers()
test_scan_connection()
astro.test.connection_test.connect(hostname, port, timeout)
astro.test.connection_test.oracle_connect(connectstring, timeout)
astro.test.connection_test.timeoutoccurred(*args, **kwargs)

astro.test.dependency_test module

Test to see if the various required packages are available

astro.test.dependency_test.get_version_bertin(program_name)

Function to extract the version of Sextractor, SWarp

astro.test.dependency_test.get_version_cosmicfits(program_name)
astro.test.dependency_test.get_version_cx_oracle()
astro.test.dependency_test.get_version_eclipse()
astro.test.dependency_test.get_version_ellipfit(program_name)
astro.test.dependency_test.get_version_galfit(program_name)
astro.test.dependency_test.get_version_ldac(program_name)

Function to extract the version of an ldac program

astro.test.dependency_test.get_version_ldactoasc(program_name)
astro.test.dependency_test.get_version_numpy()
astro.test.dependency_test.get_version_pyfits()
astro.test.dependency_test.get_version_pylab()
astro.test.dependency_test.get_version_tiny1(program_name)
astro.test.dependency_test.get_version_tiny2(program_name)
astro.test.dependency_test.get_version_tiny3(program_name)
astro.test.dependency_test.get_version_wcstools(program_name)
class astro.test.dependency_test.testEnvironment(methodName='runTest')

Bases: unittest.case.TestCase

test_astro_refcat()
test_oracle_home()

ORACLE_HOME should not have a trailing /

class astro.test.dependency_test.testExternalPrograms(methodName='runTest')

Bases: astro.test.multicasetest.TestMultipleCases

cases = ['add_image_calibs', 'aplastrom', 'aplphotom', 'asctoldac', 'associate', 'astrom', 'preastrom', 'prephotom', 'photom', 'ldacaddkey', 'ldacconcat', 'ldacconv', 'ldacdelkey', 'ldacdesc', 'ldacfilter', 'ldacjoinkey', 'ldacpaste', 'ldacrenkey', 'ldacseparate', 'ldactoasc', 'make_distort', 'make_ssc', 'cosmicfits', 'ellipfit', 'fitscopy', 'galfit', 'imcopy', 'psfex', 'scamp', 'sex', 'stiff', 'swarp', 'tiny1', 'tiny2', 'tiny3', 'gaap-corr.csh', 'gpsf-noplots.csh']
test_programs(program_name)

Test availability of external programs

test_versions(program_name)

Test versions of external programs

class astro.test.dependency_test.testPythonModules(methodName='runTest')

Bases: astro.test.multicasetest.TestMultipleCases

cases = ['cx_Oracle', 'eclipse', 'numpy', 'pyfits', 'pylab']
test_dependency(module_name)

Test availability of Python modules

test_versions(module_name)

astro.test.dpu_unittestjob module

class astro.test.dpu_unittestjob.UnitTestJob(url=None, tests=None, env={})

Bases: object

env = {}
execute()
tests = ['functional', 'processing', 'recipes', 'services', 'filerecipes', 'database']
url = 'http://drive.astro-wise.org:8000/unittestdata/'
astro.test.dpu_unittestjob.main()

astro.test.dpu_unittests module

astro.test.dpu_unittests.getresults(c, jobid, tests)
astro.test.dpu_unittests.main()

astro.test.firewall_test module

class astro.test.firewall_test.TestNetworkConnectionToDatabase(methodName='runTest')

Bases: unittest.case.TestCase

setUp()
test_node_connection()
astro.test.firewall_test.connect(hostname, port, timeout)

astro.test.make_test_data module

astro.test.matplotlib_agg module

astro.test.multicasetest module

class astro.test.multicasetest.TestMultipleCases(methodName='runTest')

Bases: unittest.case.TestCase

A class whose instances test multiple 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.

Instances should define an iterable atribute ‘cases’. The test methods will be called once for each item in self.cases. Each case may generate its own failure or error. Therefore each test method may generate multiple failures/errors. A test method is deemed to have passed succesfully if none of the cases genereated an error

The cases attribute can be generated at class definition time, at initialization time or in the setUp method

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. Hence, the __init__ method should not be changed to pass a list of cases to the instance

cases = None

astro.test.regression_test module

Regression testing framework

Adapted from: http://www.diveintopython.org/regression_divein.html

class astro.test.regression_test.RegressionTestResult

Bases: unittest.result.TestResult

A helper class to keep track of successful tests too.

addSuccess(test)
astro.test.regression_test.database_test()

Execute the tests from test modules in database/

astro.test.regression_test.filerecipes_test()

Execute the tests from test modules in filerecipes/

astro.test.regression_test.functional_test()

Execute the tests from test modules in functional/

astro.test.regression_test.get_files(path, pattern)

Return a list of files matching pattern from path.

astro.test.regression_test.get_modules(files)

Return a list of modules imported from the list of files.

astro.test.regression_test.main()
astro.test.regression_test.omegacen_test()

Execute the tests from test modules in omegacen/

astro.test.regression_test.processing_test()

Execute the tests from test modules in processing/

astro.test.regression_test.recipes_test()

Execute the tests from test modules in recipes/

astro.test.regression_test.regression_test(path, pattern='*test.py')

Build a test_suite from test_cases defined in files in path matching pattern.

astro.test.regression_test.services_test()

Execute the tests from test modules in services/

astro.test.regression_test.test_module(module)
astro.test.regression_test.test_module_as_script(module, infix)

astro.test.startup_test module

Test to see if the various required packages are available

class astro.test.startup_test.EnvironmentTest

Bases: object

directories = ['baseconf_dir', 'log_dir', 'testdata_dir']
test()
test_astro_refcat()
test_existence(environment_key)

Test existence of directories defined in Env

test_oracle_home()

ORACLE_HOME should not have a trailing /

class astro.test.startup_test.ExternalProgramsTest

Bases: object

no_version_tag = ['cosmicfits', 'imcopy', 'fitscopy', 'ellipfit', 'gaap-corr.csh', 'gpsf-noplots.csh']
not_installed = ['tiny1', 'tiny2', 'tiny3']
programs = ['add_image_calibs', 'aplastrom', 'aplphotom', 'asctoldac', 'associate', 'astrom', 'preastrom', 'prephotom', 'photom', 'ldacaddkey', 'ldacconcat', 'ldacconv', 'ldacdelkey', 'ldacdesc', 'ldacfilter', 'ldacjoinkey', 'ldacpaste', 'ldacrenkey', 'ldacseparate', 'ldactoasc', 'make_distort', 'make_ssc', 'cosmicfits', 'ellipfit', 'fitscopy', 'galfit', 'imcopy', 'psfex', 'scamp', 'sex', 'stiff', 'swarp', 'tiny1', 'tiny2', 'tiny3', 'gaap-corr.csh', 'gpsf-noplots.csh']
test()
test_program(program_name)

Test availability of external programs

test_version(program_name)

Test versions of external programs

version_map = {'psfex': (<function get_version_bertin at 0x7f62064b5a60>, '3.17.1'), 'prephotom': (<function get_version_ldac at 0x7f62064b5268>, '2.3'), 'cosmicfits': (<function get_version_cosmicfits at 0x7f62064b5488>, '0'), 'astrom': (<function get_version_ldac at 0x7f62064b5268>, '1.1.0'), 'photom': (<function get_version_ldac at 0x7f62064b5268>, '1.1'), 'ldacconcat': (<function get_version_ldac at 0x7f62064b5268>, '1.0'), 'ldacaddkey': (<function get_version_ldac at 0x7f62064b5268>, '1.0'), 'aplastrom': (<function get_version_ldac at 0x7f62064b5268>, '1.1.1'), 'make_distort': (<function get_version_ldac at 0x7f62064b5268>, '1.1.1'), 'stiff': (<function get_version_bertin at 0x7f62064b5a60>, '2.1.3'), 'ldacrenkey': (<function get_version_ldac at 0x7f62064b5268>, '1.0'), 'ldacdelkey': (<function get_version_ldac at 0x7f62064b5268>, '1.0'), 'ellipfit': (<function get_version_ellipfit at 0x7f62064b5378>, '0'), 'ldacconv': (<function get_version_ldac at 0x7f62064b5268>, '1.0.0'), 'ldactoasc': (<function get_version_ldac at 0x7f62064b5268>, '1.0'), 'scamp': (<function get_version_bertin at 0x7f62064b5a60>, '1.7.0'), 'aplphotom': (<function get_version_ldac at 0x7f62064b5268>, '1.6.1'), 'associate': (<function get_version_ldac at 0x7f62064b5268>, '1.3.4'), 'fitscopy': (<function get_version_wcstools at 0x7f6204ff49d8>, '0'), 'tiny3': (<function get_version_tiny3 at 0x7f6204ff4950>, '6.3'), 'make_ssc': (<function get_version_ldac at 0x7f62064b5268>, '2.0.3'), 'add_image_calibs': (<function get_version_ldac at 0x7f62064b5268>, '1.3.3'), 'tiny2': (<function get_version_tiny2 at 0x7f6204ff48c8>, '6.3'), 'preastrom': (<function get_version_ldac at 0x7f62064b5268>, '2.0.2'), 'imcopy': (<function get_version_wcstools at 0x7f6204ff49d8>, '0'), 'ldacseparate': (<function get_version_ldac at 0x7f62064b5268>, '1.0'), 'galfit': (<function get_version_galfit at 0x7f62064b5158>, '2.0.3c'), 'asctoldac': (<function get_version_ldac at 0x7f62064b5268>, '0'), 'swarp': (<function get_version_bertin at 0x7f62064b5a60>, '2.17.6'), 'ldacdesc': (<function get_version_ldac at 0x7f62064b5268>, '1.0'), 'sex': (<function get_version_bertin at 0x7f62064b5a60>, '2.8.6'), 'ldacjoinkey': (<function get_version_ldac at 0x7f62064b5268>, '1.0'), 'ldacpaste': (<function get_version_ldac at 0x7f62064b5268>, '1.0'), 'ldacfilter': (<function get_version_ldac at 0x7f62064b5268>, '1.3.1'), 'tiny1': (<function get_version_tiny1 at 0x7f6205476d90>, '6.3')}
class astro.test.startup_test.PythonModulesTest

Bases: object

modules = ['cx_Oracle', 'eclipse', 'numpy', 'pyfits', 'pylab']
test()
test_module(module_name)

Test availability of Python modules

test_version(module_name)
astro.test.startup_test.startup_test()

astro.test.testpath module

Path to testdata

astro.test.testpath.get_abspath(filename)

Return the complete absolute path for a file

astro.test.testpath.localpath(pathname)

Create a local symlink.

astro.test.testpath.testpath(fname)

Join fname to Env[‘testdata_dir’]

Module contents

Procedures to test the functionality and integrity of the software

This packag contains packages/modules and a few scripts to be used from the command-line.

Package/Module | Provided functionality

multicasetest | Module containing framework for handling multiple test cases
that differ only in a single aspect.

functional | Package containing all functional tests. processing | Package containing all processing tests. recipes | Package containing all recipes tests. filerecipes | ? services | ? database | ? omegacen | Tests that rely on the OmegaCEN infrastructure specifics. ——————————————————————————–

Additionally the following scripts are available in the astro/test directory :

dependency_test.py - Verifies the existence of required packages. regression_test.py - Runs all functional, processing and/or recipes tests. make_test_data.py - Produces test data.