diff --git a/tests/direct_indexing/cleaning/test_metadata.py b/tests/direct_indexing/cleaning/test_metadata.py index 6049619bc..dda52f75d 100644 --- a/tests/direct_indexing/cleaning/test_metadata.py +++ b/tests/direct_indexing/cleaning/test_metadata.py @@ -70,7 +70,7 @@ def fixture_dataset_metadata(): "description": "", "metadata_modified": "2022-05-05T23:56:00.301819", "cache_last_updated": "", - "url": "http://formin.finland.fi/opendata/IATI/Finland_total_2012.xml", + "url": "https://formin.finland.fi/opendata/IATI/Finland_total_2012.xml", "format": "iati-xml", "state": "active", "created": "2022-04-20T07:16:11.709336", diff --git a/tests/direct_indexing/custom_fields/test_codelists.py b/tests/direct_indexing/custom_fields/test_codelists.py index ef33d26cd..682f98a6f 100644 --- a/tests/direct_indexing/custom_fields/test_codelists.py +++ b/tests/direct_indexing/custom_fields/test_codelists.py @@ -1856,14 +1856,14 @@ def fixture_cl(monkeypatch): "code": "2", "name": "UN Sustainable Development Goals (SDG)", "description": "A value from the top-level list of UN sustainable development goals (SDGs) (e.g. \u20181\u2019)", # NOQA: E501 - "url": "http://reference.iatistandard.org/codelists/UNSDG-Goals/", + "url": "https://reference.iatistandard.org/codelists/UNSDG-Goals/", "status": "active" }, { "code": "3", "name": "UN Sustainable Development Goals (SDG) Targets", "description": "A value from the second-level list of UN sustainable development goals (SDGs) (e.g. \u20181.1\u2019)", # NOQA: E501 - "url": "http://reference.iatistandard.org/codelists/UNSDG-Targets/", + "url": "https://reference.iatistandard.org/codelists/UNSDG-Targets/", "status": "active" }, { @@ -2246,7 +2246,7 @@ def fixture_cl(monkeypatch): "code": "1", "name": "OECD DAC CRS", "description": "The policy marker is an OECD DAC CRS policy marker, Reported in columns 20-23, 28-31 and 54 of CRS++ reporting format.", # NOQA: E501 - "url": "http://reference.iatistandard.org/codelists/PolicyMarker/", + "url": "https://reference.iatistandard.org/codelists/PolicyMarker/", "status": "active" }, { diff --git a/tests/direct_indexing/metadata/test_dataset.py b/tests/direct_indexing/metadata/test_dataset.py index 4da5a1e7c..d63232426 100644 --- a/tests/direct_indexing/metadata/test_dataset.py +++ b/tests/direct_indexing/metadata/test_dataset.py @@ -92,8 +92,8 @@ def test_load_codelists(mocker): def test__get_existing_datasets(mocker, requests_mock, fixture_solr_dataset, fixture_existing_datasets): - mocker.patch('direct_indexing.metadata.dataset.settings.SOLR_DATASET', "http://test.com") - requests_mock.get("http://test.com" + ( + mocker.patch('direct_indexing.metadata.dataset.settings.SOLR_DATASET', "https://test.com") + requests_mock.get("https://test.com" + ( '/select?q=resources.hash:* AND extras.filetype:*' ' AND id:*&rows=100000&wt=json&fl=resources.hash,id,extras.filetype' ), json=fixture_solr_dataset) diff --git a/tests/direct_indexing/metadata/test_util.py b/tests/direct_indexing/metadata/test_util.py index e5f567610..b63fa6f54 100644 --- a/tests/direct_indexing/metadata/test_util.py +++ b/tests/direct_indexing/metadata/test_util.py @@ -10,7 +10,7 @@ # consts SETTINGS_FRESH = 'direct_indexing.metadata.util.settings.FRESH' SETTINGS_DATASET_PARENT_PATH = 'direct_indexing.metadata.util.settings.DATASET_PARENT_PATH' -TEST_URL = 'http://test.com' +TEST_URL = 'https://test.com' def test_retrieve(mocker, tmp_path, sample_data, requests_mock): diff --git a/tests/direct_indexing/processing/test_activity_subtypes.py b/tests/direct_indexing/processing/test_activity_subtypes.py index 4750854a4..add89730d 100644 --- a/tests/direct_indexing/processing/test_activity_subtypes.py +++ b/tests/direct_indexing/processing/test_activity_subtypes.py @@ -31,11 +31,11 @@ def test_process_subtype_dict(mocker): expected_res = subtype_dict.copy() key = 'transaction' mock = mocker.MagicMock() - res = process_subtype_dict(subtype_dict, key, mock, None, None, None) + res = process_subtype_dict(subtype_dict, key, mock, mock, None, None) assert res == expected_res # Test if key is in exclude fields we do not include it in the subtype dict - res = process_subtype_dict(subtype_dict, bvu, mock, None, [bvu], None) + res = process_subtype_dict(subtype_dict, bvu, mock, mock, [bvu], None) assert res == expected_res # Test that a specific value which is a dict can be retrieved diff --git a/tests/direct_indexing/processing/test_util.py b/tests/direct_indexing/processing/test_util.py index 9367b2d8c..6ef31da0c 100644 --- a/tests/direct_indexing/processing/test_util.py +++ b/tests/direct_indexing/processing/test_util.py @@ -107,7 +107,7 @@ def fixture_dataset_activity(): "description": None, "metadata_modified": "2023-10-29T05:49:15.354998", "cache_last_updated": None, - "url": "http://iati.fcdo.gov.uk/iati_files/solr/FCDO-set-1.xml", + "url": "https://iati.fcdo.gov.uk/iati_files/solr/FCDO-set-1.xml", "format": "IATI-XML", "state": "active", "created": "2023-10-29T05:49:12.216564", @@ -170,7 +170,7 @@ def fixture_dataset_activity(): "value": "Not Found" } ], - "license_url": "http://reference.data.gov.uk/id/open-government-licence", + "license_url": "https://reference.data.gov.uk/id/open-government-licence", "organization": { "description": "", "title": "UK - Foreign, Commonwealth and Development Office", @@ -178,7 +178,7 @@ def fixture_dataset_activity(): "approval_status": "approved", "is_organization": True, "state": "active", - "image_url": "http://iati.fcdo.gov.uk/iati_files/FCDO_logo.png", + "image_url": "https://iati.fcdo.gov.uk/iati_files/FCDO_logo.png", "type": "organization", "id": "4da32e41-a060-4d75-86c1-4b627eb22647", "name": "fcdo" @@ -213,7 +213,7 @@ def fixture_dataset_organisation(): "description": "", "metadata_modified": "2023-11-03T04:58:51.148529", "cache_last_updated": None, - "url": "http://iati.fcdo.gov.uk/iati_files/organisation.xml", + "url": "https://iati.fcdo.gov.uk/iati_files/organisation.xml", "format": "IATI-XML", "state": "active", "created": "2020-09-01T11:35:05.318259", @@ -273,7 +273,7 @@ def fixture_dataset_organisation(): "value": "Success" } ], - "license_url": "http://reference.data.gov.uk/id/open-government-licence", + "license_url": "https://reference.data.gov.uk/id/open-government-licence", "organization": { "description": "", "title": "UK - Foreign, Commonwealth and Development Office", @@ -281,7 +281,7 @@ def fixture_dataset_organisation(): "approval_status": "approved", "is_organization": True, "state": "active", - "image_url": "http://iati.fcdo.gov.uk/iati_files/FCDO_logo.png", + "image_url": "https://iati.fcdo.gov.uk/iati_files/FCDO_logo.png", "type": "organization", "id": "4da32e41-a060-4d75-86c1-4b627eb22647", "name": "fcdo" diff --git a/tests/direct_indexing/test_util.py b/tests/direct_indexing/test_util.py index bf51c4dc7..7eef34d34 100644 --- a/tests/direct_indexing/test_util.py +++ b/tests/direct_indexing/test_util.py @@ -12,7 +12,7 @@ # Test clear_core function def test_clear_core(mocker): # Define the core URL - core_url = "http://example.com/solr/core" + core_url = "https://example.com/solr/core" # Mock the pysolr.Solr instance mock_solr = mocker.patch('pysolr.Solr') @@ -53,7 +53,7 @@ def test_index_to_core(tmp_path, mocker): with open(json_path, 'w') as file: file.write('{"key": "value"}') - url = "http://example.com/solr/core" + url = "https://example.com/solr/core" OP = "subprocess.check_output" # SUCCESSFUL INDEX: # Mock subprocess.check_output to simulate success