geonode.harvesting.tests.harvesters.test_harvester ================================================== .. py:module:: geonode.harvesting.tests.harvesters.test_harvester Classes ------- .. autoapisummary:: geonode.harvesting.tests.harvesters.test_harvester.TestHarvester Module Contents --------------- .. py:class:: TestHarvester(remote_url: str, harvester_id: int) Bases: :py:obj:`geonode.harvesting.harvesters.base.BaseHarvesterWorker` Override base harvester as test harvester .. py:property:: allows_copying_resources :type: bool Whether copying remote resources is implemented by this worker .. py:method:: from_django_record(record: geonode.harvesting.models.Harvester) :classmethod: Return a new instance of the worker from the django harvester .. py:method:: get_num_available_resources() -> int Return the number of available resources on the remote service. If there is a problem retrieving the number of available resource, this method shall raise `HarvestingException`. .. py:method:: list_resources(offset: Optional[int] = 0) -> List[geonode.harvesting.harvesters.base.BriefRemoteResource] Return a list of resources from the remote service. If there is a problem listing resource, this method shall raise `HarvestingException`. .. py:method:: check_availability(timeout_seconds: Optional[int] = 5) -> bool Check whether the remote service is online .. py:method:: get_resource(harvestable_resource: geonode.harvesting.models.HarvestableResource, harvesting_session_id: int) -> Optional[geonode.harvesting.harvesters.base.HarvestedResourceInfo] Harvest a single resource from the remote service. The return value is an instance of `HarvestedResourceInfo`. It stores an instance of `RecordDescription` and additionally whatever type is required by child classes to be able to customize resource creation/update on the local GeoNode. Note that the default implementation of `update_geonode_resource()` only needs the `RecordDescription`. The possibility to return additional information exists solely for extensibility purposes and can be left as None in the simple cases. .. py:method:: get_geonode_resource_type(remote_resource_type: str) Return resource type class from resource type string.