remove unused import

This commit is contained in:
Florian Förster 2025-03-14 12:24:19 +01:00
parent a8e9a3466e
commit 183c72c96d

View File

@ -1,5 +1,3 @@
from unittest.mock import patch
import pytest import pytest
from pydantic import ValidationError from pydantic import ValidationError
@ -10,59 +8,6 @@ from delta_barth.errors import (
) )
from delta_barth.types import HttpRequestTypes from delta_barth.types import HttpRequestTypes
# @pytest.fixture(scope="session")
# def auth_response() -> MockResponse:
# json_data = {"message": "GenericError", "code": "TestLogin", "hints": "TestCase"}
# return MockResponse(401, json_data)
# @pytest.fixture(scope="session")
# def fail_response() -> MockResponse:
# json_data = {"message": "GenericError", "code": "Test123", "hints": "TestCase"}
# return MockResponse(500, json_data)
# @pytest.fixture
# def mock_response():
# with patch("requests.put") as mock_get:
# yield mock_get
@pytest.mark.parametrize(
["case", "expect"],
[
("http://test.com/ ", "http://test.com"),
("http://test.com/", "http://test.com"),
("http://test.com ", "http://test.com"),
("http://test.com// ", "http://test.com"),
("http://test.com", "http://test.com"),
(" /http://test.com", "http://test.com"),
(" //http://test.com", "http://test.com"),
("//http://test.com", "http://test.com"),
],
)
def test_strip_url_components(case, expect):
res = common._strip_url_components(case)
assert res == expect
@pytest.mark.parametrize(
["base", "route", "expect"],
[
("http://test.com/ ", "ping", "http://test.com/ping"),
("http://test.com/", "ping ", "http://test.com/ping"),
("http://test.com ", "ping/", "http://test.com/ping"),
("http://test.com// ", "ping", "http://test.com/ping"),
("http://test.com", "/ping ", "http://test.com/ping"),
(" /http://test.com", "/ ping/ ", "http://test.com/ping"),
(" //http://test.com", "ping", "http://test.com/ping"),
("//http://test.com", "// ping// ", "http://test.com/ping"),
],
)
def test_combine_route(base, route, expect):
res = common.combine_route(base, route)
assert res == expect
def test_validate_creds(credentials): def test_validate_creds(credentials):
creds = common.validate_credentials( creds = common.validate_credentials(