# Path: via/services/via_client.py
# class ViaClientService:
#     """A wrapper service for h_vialib.ViaClient."""
# 
#     def __init__(self, via_client):
#         self.via_client = via_client
# 
#     @staticmethod
#     def is_pdf(mime_type):
#         """Return True if the given MIME type is a PDF one."""
#         return mime_type in ("application/x-pdf", "application/pdf")
# 
#     def url_for(self, url, mime_type, params):
#         """Return a Via URL for the given `url`."""
#         return self.via_client.url_for(
#             url,
#             content_type="pdf" if self.is_pdf(mime_type) else "html",
#             options=params,
#         )
# 
# def factory(_context, request):
#     return ViaClientService(
#         via_client=ViaClient(
#             service_url=request.host_url,
#             html_service_url=request.registry.settings["via_html_url"],
#             secret=request.registry.settings["via_secret"],
#         )
#     )


from unittest.mock import sentinel
from via.services.via_client import ViaClientService, factory
import pytest
        url = svc.url_for(sentinel.url, mime_type, params)

        via_client.url_for.assert_called_once_with(
            sentinel.url, expected_content_type, params
        )
        assert url == via_client.url_for.return_value

    @pytest.fixture
    def svc(self, via_client):
        return ViaClientService(via_client)


class TestFactory:
    def test_it(self, pyramid_request, ViaClient, ViaClientService):
        pyramid_request.registry.settings = {
            "via_html_url": sentinel.via_html_url,
            "via_secret": sentinel.via_secret,
        }

        service = factory(sentinel.context, pyramid_request)

        ViaClient.assert_called_once_with(
            service_url=pyramid_request.host_url,
            html_service_url=sentinel.via_html_url,
            secret=sentinel.via_secret,
        )
        ViaClientService.assert_called_once_with(ViaClient.return_value)
        assert service == ViaClientService.return_value

    @pytest.fixture(autouse=True)

# Path: via/services/via_client.py
# class ViaClientService:
#     """A wrapper service for h_vialib.ViaClient."""
# 
#     def __init__(self, via_client):
#         self.via_client = via_client
# 
#     @staticmethod
#     def is_pdf(mime_type):
#         """Return True if the given MIME type is a PDF one."""
#         return mime_type in ("application/x-pdf", "application/pdf")
# 
#     def url_for(self, url, mime_type, params):
#         """Return a Via URL for the given `url`."""
#         return self.via_client.url_for(
#             url,
#             content_type="pdf" if self.is_pdf(mime_type) else "html",
#             options=params,
#         )
# 
# def factory(_context, request):
#     return ViaClientService(
#         via_client=ViaClient(
#             service_url=request.host_url,
#             html_service_url=request.registry.settings["via_html_url"],
#             secret=request.registry.settings["via_secret"],
#         )
#     )


# Path: tests/unit/via/services/via_client_test.py
from unittest.mock import sentinel
from via.services.via_client import ViaClientService, factory
import pytest

        url = svc.url_for(sentinel.url, mime_type, params)

        via_client.url_for.assert_called_once_with(
            sentinel.url, expected_content_type, params
        )
        assert url == via_client.url_for.return_value

    @pytest.fixture
    def svc(self, via_client):
        return ViaClientService(via_client)


class TestFactory:
    def test_it(self, pyramid_request, ViaClient, ViaClientService):
        pyramid_request.registry.settings = {
            "via_html_url": sentinel.via_html_url,
            "via_secret": sentinel.via_secret,
        }

        service = factory(sentinel.context, pyramid_request)

        ViaClient.assert_called_once_with(
            service_url=pyramid_request.host_url,
            html_service_url=sentinel.via_html_url,
            secret=sentinel.via_secret,
        )
        ViaClientService.assert_called_once_with(ViaClient.return_value)
        assert service == ViaClientService.return_value

    @pytest.fixture(autouse=True)

    def ViaClientService(self, patch):