geonode.harvesting.tests.test_tasks

Classes

TasksTestCase

Module Contents

class geonode.harvesting.tests.test_tasks.TasksTestCase[source]

Bases: geonode.tests.base.GeoNodeBaseTestSupport

harvester: geonode.harvesting.models.Harvester[source]
harvester_remote_url = 'fake url'[source]
harvester_name = 'harvester1'[source]
harvester_owner[source]
harvester_type = 'geonode.harvesting.harvesters.geonodeharvester.GeonodeLegacyHarvester'[source]
classmethod setUpTestData()[source]
test_harvest_resource_updates_geonode_when_remote_resource_exists(mock_update_asynchronous_session)[source]

Test that worker.get_resource() is called by the _harvest_resource() task and that the related workflow is called too.

Verify that worker.get_resource() is always called. Then verify that if the result of worker.get_resource() is not None, the worker.update_geonode_resource() is called and worker.update_harvesting_session() is called too.

test_harvest_resource_does_not_update_geonode_when_remote_resource_does_not_exist()[source]

Test that the worker does not try to update existing GeoNode resources when the remote resource cannot be harvested.

test_finish_harvesting_updates_harvester_status()[source]
test_handle_harvesting_error_cleans_up_harvest_execution()[source]
test_check_harvester_available(mock_harvester_model)[source]
test_update_harvestable_resources_sends_batched_requests(mock_models, mock_chord, mock_batch, mock_finalizer, mock_error_handler)[source]

Verify that the update_harvestable_resources task creates a celery chord with the batched task, a finalizer and an error handler.

test_harvesting_scheduler()[source]