academic_observatory_workflows.doi_workflow.tests.test_doi_workflow
Module Contents
Classes
Tests for the functions used by the Doi workflow |
Functions
|
Query a BigQuery table, sorting the results and returning results as a list of dicts. |
Attributes
- academic_observatory_workflows.doi_workflow.tests.test_doi_workflow.query_table(table_id: str, order_by_field: str) List[Dict] [source]
Query a BigQuery table, sorting the results and returning results as a list of dicts.
- Parameters:
table_id – the table id.
order_by_field – what field or fields to order by.
- Returns:
the table rows.
- class academic_observatory_workflows.doi_workflow.tests.test_doi_workflow.TestDoiWorkflow(*args, **kwargs)[source]
Bases:
observatory.platform.observatory_environment.ObservatoryTestCase
Tests for the functions used by the Doi workflow
- test_ror_to_ror_hierarchy_index()[source]
Test ror_to_ror_hierarchy_index. Check that correct ancestor relationships created.
- assert_aggregate(expected: List[Dict], actual: List[Dict])[source]
Assert an aggregate table.
- Parameters:
expected – the expected rows.
actual – the actual rows.
- Returns:
None.
- assert_sub_fields(expected: Dict, actual: Dict, field: str, sub_fields: List[str])[source]
Checks that the sub fields in the aggregate match.
- Parameters:
expected – the expected item.
actual – the actual item.
field – the field name.
sub_fields – the sub field name.
- Returns:
- assert_doi(expected: List[Dict], actual: List[Dict])[source]
Assert the DOI table.
- Parameters:
expected – the expected DOI table rows.
actual – the actual DOI table rows.
- Returns:
None.
- assert_doi_events(expected: Dict, actual: Dict)[source]
Assert the DOI table events field.
- Parameters:
expected – the expected events field.
actual – the actual events field.
- Returns:
None