academic_observatory_workflows.oa_dashboard_workflow.tests.test_oa_dashboard_workflow

Module Contents

Classes

TestFunctions

A class whose instances are single test cases.

TestOaDashboardWorkflow

Functions

make_expected_build_files(→ List[str])

Attributes

FIXTURES_FOLDER

DOI_FIXTURES_FOLDER

DOI_SCHEMA_FOLDER

ROR_SCHEMA_FOLDER

academic_observatory_workflows.oa_dashboard_workflow.tests.test_oa_dashboard_workflow.FIXTURES_FOLDER[source]
academic_observatory_workflows.oa_dashboard_workflow.tests.test_oa_dashboard_workflow.DOI_FIXTURES_FOLDER[source]
academic_observatory_workflows.oa_dashboard_workflow.tests.test_oa_dashboard_workflow.DOI_SCHEMA_FOLDER[source]
academic_observatory_workflows.oa_dashboard_workflow.tests.test_oa_dashboard_workflow.ROR_SCHEMA_FOLDER[source]
class academic_observatory_workflows.oa_dashboard_workflow.tests.test_oa_dashboard_workflow.TestFunctions(methodName='runTest')[source]

Bases: unittest.TestCase

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.

test_clean_url()[source]
test_make_logo_url()[source]
test_make_entity_stats()[source]

Test make_entity_stats

test_load_data_glob()[source]
class academic_observatory_workflows.oa_dashboard_workflow.tests.test_oa_dashboard_workflow.TestOaDashboardWorkflow[source]

Bases: observatory.platform.observatory_environment.ObservatoryTestCase

maxDiff[source]
dt_fmt = 'YYYY-MM-DD'[source]
setUp() None[source]

TestOaDashboardWorkflow checks that the workflow functions correctly, i.e. outputs the correct files, but doesn’t check that the calculations are correct (data correctness is tested in TestOaDashboardRelease).

test_dag_structure()[source]

Test that the DAG has the correct structure.

test_dag_load()[source]

Test that the DAG can be loaded from a DAG bag.

setup_tables(dataset_id_all: str, dataset_id_settings: str, bucket_name: str, snapshot_date: pendulum.DateTime)[source]
test_telescope(mock_trigger_repository_dispatch, mock_zenodo)[source]

Test the telescope end to end.

academic_observatory_workflows.oa_dashboard_workflow.tests.test_oa_dashboard_workflow.make_expected_build_files(base_path: str) List[str][source]