Esempio n. 1
0
def test_locale_information():
    result = locale_info(locale='ru')
    assert result == 'Russian'

    result_1 = locale_info(locale='is')
    assert result_1 == 'Icelandic'
    with pytest.raises(UnsupportedLocale):
        locale_info(locale='w')
Esempio n. 2
0
 def __str__(self) -> str:
     if hasattr(self, 'locale'):
         locale = getattr(self, 'locale')
         return '{}:{}:{}'.format(
             self.__class__.__name__,
             locale,
             locale_info(locale),
         )
     return '{}'.format(self.__class__.__name__)
Esempio n. 3
0
 def __str__(self):
     """
     Nice and pretty representation of a class.
     """
     return '{}:{}:{}'.format(
         self.__class__.__name__,
         self.locale,
         locale_info(self.locale),
     )
Esempio n. 4
0
 def __str__(self) -> str:
     """Human-readable representation of locale."""
     if hasattr(self, 'locale'):
         locale = getattr(self, 'locale')
         return '{}:{}:{}'.format(
             self.__class__.__name__,
             locale,
             locale_info(locale),
         )
     return '{}'.format(self.__class__.__name__)
Esempio n. 5
0
 def __str__(self):
     return '{}:{}:{}'.format(
         self.__class__.__name__,
         self.locale,
         locale_info(self.locale),
     )