academic_observatory_workflows.pubmed_telescope.tests.test_pubmed_telescope
Module Contents
Classes
Tests for the Pubmed telescope |
|
Functions
|
Query a BigQuery table, sorting the results and returning results as a list of dicts. |
Attributes
- academic_observatory_workflows.pubmed_telescope.tests.test_pubmed_telescope.FIXTURES_FOLDER[source]
- academic_observatory_workflows.pubmed_telescope.tests.test_pubmed_telescope.query_table(table_id: str, select_columns: 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.
select_columns – Columns to pull from the table.
order_by_field – what field or fields to order by.
- Returns:
the table rows.
- class academic_observatory_workflows.pubmed_telescope.tests.test_pubmed_telescope.TestPubMedTelescope(*args, **kwargs)[source]
Bases:
observatory.platform.observatory_environment.ObservatoryTestCase
Tests for the Pubmed telescope
- class academic_observatory_workflows.pubmed_telescope.tests.test_pubmed_telescope.TestPubMedUtils(*args, **kwargs)[source]
Bases:
observatory.platform.observatory_environment.ObservatoryTestCase
- test_download_datafiles()[source]
Test that an exmaple PubMed XMLs can be transformed successfully.
- test_save_pubmed_jsonl()[source]
Test that data can be saved from to a json.gz or a .jsonl file correctly.
- test_save_pubmed_merged_upserts()[source]
Test if records can be reliably pulled from transformed files and written to file.
- test_parse_articles()[source]
Test if PubmedArticle records (upserts) can be pulled out from a data dictionary.
- test_parse_deletes()[source]
Test if DeleteCiation records (deletes) can be pulled out from a data dictionary.
- test_add_attributes()[source]
Test that attributes from the Biopython data classes can be reliably pulled out and added to the dictionary.