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')
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__)
def __str__(self): """ Nice and pretty representation of a class. """ return '{}:{}:{}'.format( self.__class__.__name__, self.locale, locale_info(self.locale), )
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__)
def __str__(self): return '{}:{}:{}'.format( self.__class__.__name__, self.locale, locale_info(self.locale), )