コード例 #1
0
    def test_quote(self):
        'Ensure quoted text is wrapped with its quotation'
        w = Wrapper(70)
        l = ("> Kipling road was a sort of a typical East End street. People "
             "were in and out of each other's houses with each other's "
             "property all day long.")
        r = w.wrap_line(l)

        expected = ("> Kipling road was a sort of a typical East End street. People were in\n"
                    "> and out of each other's houses with each other's property all day\n"
                    "> long.")
        self.assertEqual(expected, r)
コード例 #2
0
    def test_multi(self):
        'Ensure that multiple-quotes are wrapped correctly'
        'Ensure quoted text is wrapped with its quotation'
        w = Wrapper(70)
        l = (">>> Kipling road was a sort of a typical East End street. People "
             "were in and out of each other's houses with each other's "
             "property all day long.")
        r = w.wrap_line(l)

        expected = (">>> Kipling road was a sort of a typical East End street. People were\n"
                    ">>> in and out of each other's houses with each other's property all\n"
                    ">>> day long.")
        self.assertEqual(expected, r)
コード例 #3
0
    def test_quote(self):
        'Ensure quoted text is wrapped with its quotation'
        w = Wrapper(70)
        l = ("> Kipling road was a sort of a typical East End street. People "
             "were in and out of each other's houses with each other's "
             "property all day long.")
        r = w.wrap_line(l)

        expected = (
            "> Kipling road was a sort of a typical East End street. People were in\n"
            "> and out of each other's houses with each other's property all day\n"
            "> long.")
        self.assertEqual(expected, r)
コード例 #4
0
    def test_multi(self):
        'Ensure that multiple-quotes are wrapped correctly'
        'Ensure quoted text is wrapped with its quotation'
        w = Wrapper(70)
        l = (
            ">>> Kipling road was a sort of a typical East End street. People "
            "were in and out of each other's houses with each other's "
            "property all day long.")
        r = w.wrap_line(l)

        expected = (
            ">>> Kipling road was a sort of a typical East End street. People were\n"
            ">>> in and out of each other's houses with each other's property all\n"
            ">>> day long.")
        self.assertEqual(expected, r)
コード例 #5
0
    def test_whitespace(self):
        'Ensure whitespace is collapsed'
        w = Wrapper(70)
        r = w.wrap_line(' ')

        self.assertEqual('', r)
コード例 #6
0
    def test_empty(self):
        'Ensure an empty string is empty when wrapped'
        w = Wrapper(70)
        r = w.wrap_line('')

        self.assertEqual('', r)
コード例 #7
0
    def test_short_line(self):
        w = Wrapper(70)
        msg = 'Tonight on Ethel the Frog we look at violence.'
        r = w.wrap_line('Tonight on Ethel the Frog we look at violence.')

        self.assertEqual(msg, r)
コード例 #8
0
    def test_whitespace(self):
        'Ensure whitespace is collapsed'
        w = Wrapper(70)
        r = w.wrap_line(' ')

        self.assertEqual('', r)
コード例 #9
0
    def test_empty(self):
        'Ensure an empty string is empty when wrapped'
        w = Wrapper(70)
        r = w.wrap_line('')

        self.assertEqual('', r)
コード例 #10
0
    def test_short_line(self):
        w = Wrapper(70)
        msg = 'Tonight on Ethel the Frog we look at violence.'
        r = w.wrap_line('Tonight on Ethel the Frog we look at violence.')

        self.assertEqual(msg, r)