From cd7aa10b166e8dcd0381fc640f1d7f87181cbdd4 Mon Sep 17 00:00:00 2001 From: Michael Moen Allport Date: Thu, 28 Nov 2024 14:13:17 +0100 Subject: [PATCH] Remove backport tests --- tests/test_backports.py | 59 ----------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 tests/test_backports.py diff --git a/tests/test_backports.py b/tests/test_backports.py deleted file mode 100644 index ca878c1..0000000 --- a/tests/test_backports.py +++ /dev/null @@ -1,59 +0,0 @@ -import os -from unittest import mock -from unittest.mock import Mock - -from dapla.backports import show -from dapla.gcs import GCSFileSystem - - -@mock.patch.dict( - "dapla.auth.os.environ", - { - "DAPLA_REGION": "DAPLA_LAB", - }, - clear=True, -) -@mock.patch("dapla.backports.FileClient") -def test_show_all_subfolders(file_client_mock: Mock) -> None: - assert os.getenv("DAPLA_REGION") == "DAPLA_LAB" - file_client_mock.get_gcs_file_system.return_value = GCSFileSystem() - result = show("gs://anaconda-public-data/nyc-taxi/") - assert result == [ - "/nyc-taxi/2015.parquet", - "/nyc-taxi/csv", - "/nyc-taxi/csv/2014", - "/nyc-taxi/csv/2015", - "/nyc-taxi/csv/2016", - "/nyc-taxi/nyc.parquet", - "/nyc-taxi/taxi.parquet", - ] - - -@mock.patch.dict( - "dapla.auth.os.environ", - { - "DAPLA_REGION": "DAPLA_LAB", - }, - clear=True, -) -@mock.patch("dapla.backports.FileClient") -def test_show_leaf_folder(file_client_mock: Mock) -> None: - assert os.getenv("DAPLA_REGION") == "DAPLA_LAB" - file_client_mock.get_gcs_file_system.return_value = GCSFileSystem() - result = show("gs://anaconda-public-data/nyc-taxi/csv/2014") - assert result == ["/nyc-taxi/csv/2014"] - - -@mock.patch.dict( - "dapla.auth.os.environ", - { - "DAPLA_REGION": "DAPLA_LAB", - }, - clear=True, -) -@mock.patch("dapla.backports.FileClient") -def test_show_invalid_folder(file_client_mock: Mock) -> None: - assert os.getenv("DAPLA_REGION") == "DAPLA_LAB" - file_client_mock.get_gcs_file_system.return_value = GCSFileSystem() - result = show("gs://anaconda-public-data/nyc-taxi/unknown") - assert result == []