コード例 #1
0
    def label_address(self) -> str:
        label_address = self.basic_address

        if len(label_address) <= 60:
            label_address = rreplace(label_address, ',', '<br/>', count=1)

        return label_address
コード例 #2
0
ファイル: address.py プロジェクト: fossabot/correios-1
    def label_address(self) -> str:
        label_address = self.basic_address

        if len(label_address) <= 55:
            label_address = rreplace(label_address, ",", "<br/>", count=1)

        return label_address
コード例 #3
0
ファイル: address.py プロジェクト: solidarium/correios
    def label_address(self) -> str:
        label_address = self.basic_address

        if len(label_address) <= 60:
            label_address = rreplace(label_address, ',', '<br/>', count=1)

        return label_address
コード例 #4
0
ファイル: test_utils.py プロジェクト: solidarium/correios
def test_rreplace():
    phrase = 'foo bar baz qux'
    assert rreplace(phrase, ' ', '-', 1) == 'foo bar baz-qux'
    assert rreplace(phrase, ' ', '-', 2) == 'foo bar-baz-qux'
    assert rreplace(phrase, ' ', '-', 3) == 'foo-bar-baz-qux'
    assert rreplace(phrase, ' ', '-') == 'foo-bar-baz-qux'
コード例 #5
0
def test_rreplace():
    phrase = 'foo bar baz qux'
    assert rreplace(phrase, ' ', '-', 1) == 'foo bar baz-qux'
    assert rreplace(phrase, ' ', '-', 2) == 'foo bar-baz-qux'
    assert rreplace(phrase, ' ', '-', 3) == 'foo-bar-baz-qux'
    assert rreplace(phrase, ' ', '-') == 'foo-bar-baz-qux'
コード例 #6
0
def test_rreplace():
    phrase = "foo bar baz qux"
    assert rreplace(phrase, " ", "-", 1) == "foo bar baz-qux"
    assert rreplace(phrase, " ", "-", 2) == "foo bar-baz-qux"
    assert rreplace(phrase, " ", "-", 3) == "foo-bar-baz-qux"
    assert rreplace(phrase, " ", "-") == "foo-bar-baz-qux"