Пример #1
0
    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
Пример #2
0
 def get_user_agent(self):
     """
     Gets User-Agent header.
     """
     client_version = get_version()
     return '/'.join([self._client_name, client_version])
Пример #3
0
 def get_user_agent(self):
     """
     Gets User-Agent header.
     """
     client_version = get_version()
     return '/'.join([self._client_name, client_version])
Пример #4
0
 def user_agent(self):
     """
     Gets User-Agent header.
     """
     client_version = get_version()
     return '/'.join([CLIENT_NAME, client_version])
Пример #5
0
"""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()
Пример #6
0
    def test_no_distribution(self, m_get_distribution):
        m_get_distribution.side_effect = DistributionNotFound

        result = get_version()

        assert result == 'dev'
Пример #7
0
from wykop.api.clients import WykopAPI
from wykop.api.exceptions import WykopAPIError
from wykop.utils import get_version

__version__ = get_version()