Skip to content

Commit

Permalink
Issue #78, code review, doing some small corrections first
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanKJSchreurs committed Nov 14, 2022
1 parent 66f005a commit c5ffaf1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


@pytest.fixture
def backend1(requests_mock,) -> str:
def backend1(requests_mock) -> str:
domain = "https://b1.test/v1"
# TODO: how to work with different API versions?
requests_mock.get(domain + "/", json={"api_version": "1.0.0"})
Expand All @@ -34,9 +34,7 @@ def backend2(requests_mock) -> str:


# as "lib_requests_mock": make a distinction with the pytest fixture that has the same name
import requests_mock as lib_requests_mock

def set_backend_to_api_version(requests_mock: lib_requests_mock.Mocker, domain: str, api_version: str) -> str:
def set_backend_to_api_version(requests_mock, domain: str, api_version: str) -> str:
"""Helper function to make the backend connection use the expected API version."""

# TODO: would like a nicer solution to make the backend fixtures match the expected API version.
Expand Down
7 changes: 3 additions & 4 deletions tests/test_backend.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from sys import implementation
from datetime import datetime
import datetime as dt

import pytest

Expand Down Expand Up @@ -215,7 +214,7 @@ def service_metadata_wmts_foo(self):
configuration={"version": "0.5.8"},
attributes={},
title="Test WMTS service",
created=datetime(2020, 4, 9, 15, 5, 8)
created=dt.datetime(2020, 4, 9, 15, 5, 8)
)

@pytest.fixture
Expand All @@ -229,7 +228,7 @@ def service_metadata_wms_bar(self):
configuration={"version": "0.5.8"},
attributes={},
title="Test WMS service",
created=datetime(2022, 2, 1, 13, 30, 3)
created=dt.datetime(2022, 2, 1, 13, 30, 3)
)

def test_list_services_simple(
Expand Down
1 change: 0 additions & 1 deletion tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
import logging
import re
from typing import Tuple, List

Expand Down

0 comments on commit c5ffaf1

Please sign in to comment.