예제 #1
0
    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))
예제 #2
0
    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))
예제 #3
0
    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))
예제 #4
0
    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))
예제 #5
0
 def label_name(self) -> str:
     return capitalize_phrase(self.name)
예제 #6
0
def test_capitalize_phrase(phrase):
    assert capitalize_phrase(phrase) == 'Foo Bar Baz Qux'
예제 #7
0
 def label_name(self) -> str:
     return capitalize_phrase(self.name)
예제 #8
0
def test_capitalize_phrase(phrase):
    assert capitalize_phrase(phrase) == 'Foo Bar Baz Qux'