From a6f251d4a454b2690a6e20566cde8d5c7ccf832b Mon Sep 17 00:00:00 2001 From: Kyle Barron Date: Thu, 22 Oct 2020 17:02:04 -0600 Subject: [PATCH 1/2] Rename http.py -> web.py --- cogeo_mosaic/backends/__init__.py | 2 +- cogeo_mosaic/backends/{http.py => web.py} | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) rename cogeo_mosaic/backends/{http.py => web.py} (93%) diff --git a/cogeo_mosaic/backends/__init__.py b/cogeo_mosaic/backends/__init__.py index a97e3bdd..055f9e8a 100644 --- a/cogeo_mosaic/backends/__init__.py +++ b/cogeo_mosaic/backends/__init__.py @@ -6,9 +6,9 @@ from cogeo_mosaic.backends.base import BaseBackend from cogeo_mosaic.backends.dynamodb import DynamoDBBackend from cogeo_mosaic.backends.file import FileBackend -from cogeo_mosaic.backends.http import HttpBackend from cogeo_mosaic.backends.s3 import S3Backend from cogeo_mosaic.backends.stac import STACBackend +from cogeo_mosaic.backends.web import HttpBackend def MosaicBackend(url: str, *args: Any, **kwargs: Any) -> BaseBackend: diff --git a/cogeo_mosaic/backends/http.py b/cogeo_mosaic/backends/web.py similarity index 93% rename from cogeo_mosaic/backends/http.py rename to cogeo_mosaic/backends/web.py index e6d0aa8d..41acabb0 100644 --- a/cogeo_mosaic/backends/http.py +++ b/cogeo_mosaic/backends/web.py @@ -1,4 +1,8 @@ -"""cogeo-mosaic HTTP backend.""" +"""cogeo-mosaic HTTP backend. + +This file is named web.py instead of http.py because http is a Python standard +lib module +""" import json from typing import Any From 937f8eedea5f31c80e1d4493ed0400038205c8e3 Mon Sep 17 00:00:00 2001 From: Kyle Barron Date: Thu, 22 Oct 2020 17:04:41 -0600 Subject: [PATCH 2/2] Rename tests --- tests/test_backends.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_backends.py b/tests/test_backends.py index ef453c72..d1a549ae 100644 --- a/tests/test_backends.py +++ b/tests/test_backends.py @@ -18,12 +18,12 @@ from cogeo_mosaic.backends import MosaicBackend from cogeo_mosaic.backends.dynamodb import DynamoDBBackend from cogeo_mosaic.backends.file import FileBackend -from cogeo_mosaic.backends.http import HttpBackend from cogeo_mosaic.backends.s3 import S3Backend from cogeo_mosaic.backends.stac import STACBackend from cogeo_mosaic.backends.stac import _fetch as stac_search from cogeo_mosaic.backends.stac import default_stac_accessor as stac_accessor from cogeo_mosaic.backends.utils import _decompress_gz +from cogeo_mosaic.backends.web import HttpBackend from cogeo_mosaic.errors import MosaicError, MosaicExistsError, NoAssetFoundError from cogeo_mosaic.mosaic import MosaicJSON @@ -145,7 +145,7 @@ def content(self): return self.data -@patch("cogeo_mosaic.backends.http.requests") +@patch("cogeo_mosaic.backends.web.requests") def test_http_backend(requests): """Test HTTP backend.""" with open(mosaic_json, "r") as f: