Example #1
0
    def test_unicode_doc(self):
        class Class:
            def meth(self):
                u"""Hyv\xe4 \xe4iti!"""

        assert_equals(getdoc(Class.meth), u'Hyv\xe4 \xe4iti!')
        assert_equals(getdoc(Class.meth), getdoc(Class().meth))
Example #2
0
    def test_multiline_doc(self):
        class Class:
            """My doc.

            In multiple lines.
            """
        assert_equals(getdoc(Class), 'My doc.\n\nIn multiple lines.')
        assert_equals(getdoc(Class), getdoc(Class()))
    def test_multiline_doc(self):
        class Class:
            """My doc.

            In multiple lines.
            """
        assert_equals(getdoc(Class), 'My doc.\n\nIn multiple lines.')
        assert_equals(getdoc(Class), getdoc(Class()))
Example #4
0
    def test_non_ascii_doc_not_in_utf8(self):
        def func():
            """Hyv\xe4 \xe4iti!"""

        expected = ('Hyv\\xe4 \\xe4iti!'
                    if not (IPY or PY3) else u'Hyv\xe4 \xe4iti!')
        assert_equals(getdoc(func), expected)
Example #5
0
 def test_no_doc(self):
     def func():
         pass
     assert_equals(getdoc(func), '')
Example #6
0
 def test_non_ascii_doc_not_in_utf8(self):
     def func():
         """Hyv\xe4 \xe4iti!"""
     expected = 'Hyv\\xe4 \\xe4iti!' \
         if not IRONPYTHON else u'Hyv\xe4 \xe4iti!'
     assert_equals(getdoc(func), expected)
Example #7
0
 def test_unicode_doc(self):
     class Class:
         def meth(self):
             u"""Hyv\xe4 \xe4iti!"""
     assert_equals(getdoc(Class.meth), u'Hyv\xe4 \xe4iti!')
     assert_equals(getdoc(Class.meth), getdoc(Class().meth))
Example #8
0
 def test_one_line_doc(self):
     def func():
         """My documentation."""
     assert_equals(getdoc(func), 'My documentation.')
 def test_no_doc(self):
     def func():
         pass
     assert_equals(getdoc(func), '')
Example #10
0
 def test_non_ascii_doc_not_in_utf8(self):
     def func():
         """Hyv\xe4 \xe4iti!"""
     expected = 'Hyv\\xe4 \\xe4iti!' \
         if not IRONPYTHON else u'Hyv\xe4 \xe4iti!'
     assert_equals(getdoc(func), expected)
Example #11
0
 def test_one_line_doc(self):
     def func():
         """My documentation."""
     assert_equals(getdoc(func), 'My documentation.')
Example #12
0
    def test_non_ascii_doc_in_utf8(self):
        def func():
            """Hyv\xc3\xa4 \xc3\xa4iti!"""

        expected = u'Hyv\xe4 \xe4iti!' if not IPY else u'Hyv\xc3\xa4 \xc3\xa4iti!'
        assert_equals(getdoc(func), expected)
 def test_non_ascii_doc_not_in_utf8(self):
     def func():
         """Hyv\xe4 \xe4iti!"""
     expected = ('Hyv\\xe4 \\xe4iti!' if not (IPY or PY3)
                 else u'Hyv\xe4 \xe4iti!')
     assert_equals(getdoc(func), expected)
Example #14
0
 def test_non_ascii_doc_in_utf8(self):
     def func():
         """Hyv\xc3\xa4 \xc3\xa4iti!"""
     expected = u'Hyv\xe4 \xe4iti!' if not IPY else u'Hyv\xc3\xa4 \xc3\xa4iti!'
     assert_equals(getdoc(func), expected)