oaebu_workflows.jstor_telescope.tests.test_jstor_telescope

Module Contents

Classes

TestTelescopeSetup

TestJstorTelescopePublisher

Tests for the Jstor telescope

TestJstorTelescopeCollection

Tests for the Jstor telescope

Functions

dummy_gmail_connection()

test_get_label_id(self, mock_account_credentials, ...)

Test getting label id both when label already exists and does not exist yet.

publisher_http_mock_sequence(country_report_url, ...)

Create a list with mocked http responses

collection_http_mock_sequence(country_json, ...)

Create a list with mocked http responses for the collection workflow of the telescope

oaebu_workflows.jstor_telescope.tests.test_jstor_telescope.dummy_gmail_connection()[source]
Return type:

airflow.models.connection.Connection

class oaebu_workflows.jstor_telescope.tests.test_jstor_telescope.TestTelescopeSetup(*args, **kwargs)[source]

Bases: observatory.platform.observatory_environment.ObservatoryTestCase

test_dag_structure()[source]

Test that the Jstor DAG has the correct structure.

test_dag_load()[source]

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

test_entity_type()[source]
class oaebu_workflows.jstor_telescope.tests.test_jstor_telescope.TestJstorTelescopePublisher(*args, **kwargs)[source]

Bases: observatory.platform.observatory_environment.ObservatoryTestCase

Tests for the Jstor telescope

Constructor which sets up variables used by tests.

Parameters:
  • args – arguments.

  • kwargs – keyword arguments.

test_telescope_publisher(mock_account_credentials, mock_build)[source]

Test the Jstor telescope end to end.

test_get_release_date()[source]

Test that the get_release_date returns the correct release date and raises an exception when dates are incorrect

class oaebu_workflows.jstor_telescope.tests.test_jstor_telescope.TestJstorTelescopeCollection(*args, **kwargs)[source]

Bases: observatory.platform.observatory_environment.ObservatoryTestCase

Tests for the Jstor telescope

test_telescope_collection(mock_account_credentials, mock_build)[source]

Test the Jstor telescope end to end.

test_get_release_date()[source]

Test that the get_release_date returns the correct release date and raises an exception when dates are incorrect

oaebu_workflows.jstor_telescope.tests.test_jstor_telescope.test_get_label_id(self, mock_account_credentials, mock_build)[source]

Test getting label id both when label already exists and does not exist yet.

oaebu_workflows.jstor_telescope.tests.test_jstor_telescope.publisher_http_mock_sequence(country_report_url, institution_report_url, wrong_publisher_report_url)[source]

Create a list with mocked http responses

Parameters:
  • country_report_url (str) – URL to country report

  • institution_report_url (str) – URL to institution report

  • wrong_publisher_report_url (str) – URL to report with a non-matching publisher id

Returns:

List with http responses

Return type:

list

oaebu_workflows.jstor_telescope.tests.test_jstor_telescope.collection_http_mock_sequence(country_json, institution_json)[source]

Create a list with mocked http responses for the collection workflow of the telescope

Parameters:
  • country_json (str) – The path to the JSON file containing the data for the country message.

  • institution_json (str) – The path to the JSON file containing the data for the institution message.

Returns:

A list of tuples representing the HTTP mock responses

Return type:

list