academic_observatory_workflows.pubmed_telescope.tests.test_tasks

Attributes

FIXTURES_FOLDER

Classes

TestPubMedUtils

Module Contents

academic_observatory_workflows.pubmed_telescope.tests.test_tasks.FIXTURES_FOLDER[source]
class academic_observatory_workflows.pubmed_telescope.tests.test_tasks.TestPubMedUtils(*args, **kwargs)[source]

Bases: observatory_platform.sandbox.test_utils.SandboxTestCase

dag_id = 'pubmed'[source]
project_id[source]
data_location[source]
ftp_server_url = 'localhost'[source]
ftp_port[source]
baseline_path = '/baseline/'[source]
updatefiles_path = '/updatefiles/'[source]
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_transform_pubmed()[source]

Test that exmaple PubMed XMLs can be transformed successfully.

test_merge_upserts_and_deletes()[source]
test_add_attributes()[source]

Test that attributes from the Biopython data classes can be reliably pulled out and added to the dictionary.

test_change_pubmed_list_structure()[source]

Test that the data in *list fields can be moved up one level to the parent field.

test_PubMedCustomEncoder()[source]

Test that files are written out as expected using the CustomEncoder for PubMed-like files.