oaebu_workflows.onix_workflow.tests.test_onix_workflow
Module Contents
Classes
Functionally test the workflow |
- class oaebu_workflows.onix_workflow.tests.test_onix_workflow.TestOnixWorkflow(*args, **kwargs)[source]
Bases:
observatory.platform.observatory_environment.ObservatoryTestCase
Functionally test the workflow
- test_make_release(mock_sel_table_suffixes)[source]
Tests that the make_release function works as intended
- test_crossref_API_calls()[source]
Test the functions that query the crossref event and metadata APIs
- test_utility_functions()[source]
Test the standalone functions in the Onix workflow that aren’t specifially tested in other classes
- setup_fake_lookup_tables(settings_dataset_id, fixtures_dataset_id, release_date, bucket_name)[source]
Create a new onix and subject lookup and country tables with their own dataset and table ids. Populate them with some fake data.
- Parameters:
settings_dataset_id (str) – The dataset to store the country table
fixtures_dataset_id (str) – The dataset to store the lookup tables
release_date (pendulum.DateTime) – The release/snapshot date
bucket_name (str) – The GCP bucket name to load the data to
- setup_input_data(data_partners, settings_dataset_id, fixtures_dataset_id, crossref_master_dataset_id, partner_dataset, onix_dataset_id, release_date, bucket_name)[source]
Uploads the data partner fixtures to their respective GCP bucket and bigquery tables. Creates the partners based on the originals - but changes the dataset ids for tests. Create a new onix and subject lookup and country tables with their own dataset and table ids.
- Parameters:
data_partners (List[str]) – The list of data partners
settings_dataset_id (str) – The dataset to store the country table
fixtures_dataset_id (str) – The dataset to store the lookup tables
partner_dataset (str) – The bigquery dataset ID to load the data partner tables to
crossref_master_dataset_id (str) – The bigquery dataset ID of the master crossref table
onix_dataaset – The Bigquery dataset ID to load the onix partner table to
release_date (pendulum.DateTime) – The release/snapshot date of sharded tables
bucket_name (str) – The name of the bucket to upload the jsonl files to
onix_dataset_id (str) –
- Returns:
The resulting OaebuPartners
- Return type: