def test_version(self, m_get_distribution): class Distribution(): def __init__(self, version): self.version = version version = mock.sentinel.version m_get_distribution.return_value = Distribution(version) result = get_version() assert result == version
def get_user_agent(self): """ Gets User-Agent header. """ client_version = get_version() return '/'.join([self._client_name, client_version])
def user_agent(self): """ Gets User-Agent header. """ client_version = get_version() return '/'.join([CLIENT_NAME, client_version])
"""Python library for the Wykop API.""" from wykop.api.v2.clients import WykopAPIv2 from wykop.api.exceptions import WykopAPIError from wykop.utils import get_version __version__ = get_version()
def test_no_distribution(self, m_get_distribution): m_get_distribution.side_effect = DistributionNotFound result = get_version() assert result == 'dev'
from wykop.api.clients import WykopAPI from wykop.api.exceptions import WykopAPIError from wykop.utils import get_version __version__ = get_version()