def basic_address(self) -> str: number = self.number if self.complement: number = "{} - {}".format(self.number, self.complement) if self.neighborhood: return capitalize_phrase("{}, {}, {}".format(self.street, number, self.neighborhood)) return capitalize_phrase("{}, {}".format(self.street, number))
def label_address(self) -> str: msg = "{}.label_address is going to be deprecated. Make sure you use SendAddress or ReceiverAddress" warnings.warn(msg.format(type(self).__name__), DeprecationWarning) template = ("{address.street!s:>.40} {address.number!s:>.8}<br/> " "{address.complement!s:>.20} {address.neighborhood!s:>.28}") return capitalize_phrase(template.format(address=self))
def label_address(self) -> str: msg = "{}.label_address is going to be deprecated. Make sure you use SendAddress or ReceiverAddress" warnings.warn(msg.format(type(self).__name__), DeprecationWarning) template = ( "{address.street!s:>.40} {address.number!s:>.8}<br/> " "{address.complement!s:>.20} {address.neighborhood!s:>.28}") return capitalize_phrase(template.format(address=self))
def label_name(self) -> str: return capitalize_phrase(self.name)
def test_capitalize_phrase(phrase): assert capitalize_phrase(phrase) == 'Foo Bar Baz Qux'