Ejemplo n.º 1
0
    def test_strip_docstring(self):
        self.assertEqual(
            'Hello.',
            docformatter.strip_docstring('''
    """Hello.

    """

    '''))
Ejemplo n.º 2
0
    def test_strip_docstring_with_single_quotes(self):
        self.assertEqual(
            'Hello.',
            docformatter.strip_docstring("""
    '''Hello.

    '''

    """))
Ejemplo n.º 3
0
    def test_strip_docstring_with_single_quotes(self):
        self.assertEqual(
            'Hello.',
            docformatter.strip_docstring("""
    '''Hello.

    '''

    """))
Ejemplo n.º 4
0
    def test_strip_docstring(self):
        self.assertEqual(
            'Hello.',
            docformatter.strip_docstring('''
    """Hello.

    """

    '''))
Ejemplo n.º 5
0
 def test_strip_docstring_with_unknown(self):
     with self.assertRaises(ValueError):
         docformatter.strip_docstring('foo')
Ejemplo n.º 6
0
 def test_strip_docstring_with_unhandled(self):
     with self.assertRaises(ValueError):
         docformatter.strip_docstring('r"""foo"""')
Ejemplo n.º 7
0
 def test_strip_docstring_with_escaped_double_quotes(self):
     self.assertEqual('hello\\"',
                      docformatter.strip_docstring('"hello\\""'))
Ejemplo n.º 8
0
 def test_strip_docstring_with_escaped_quotes(self):
     self.assertEqual("hello\\'",
                      docformatter.strip_docstring("'hello\\''"))
Ejemplo n.º 9
0
 def test_strip_docstring_with_empty_string(self):
     self.assertEqual('', docformatter.strip_docstring('""""""'))
Ejemplo n.º 10
0
 def test_strip_docstring_with_unknown(self):
     with self.assertRaises(ValueError):
         docformatter.strip_docstring('foo')
Ejemplo n.º 11
0
 def test_strip_docstring_with_unhandled(self):
     with self.assertRaises(ValueError):
         docformatter.strip_docstring('r"""foo"""')
Ejemplo n.º 12
0
 def test_strip_docstring_with_escaped_double_quotes(self):
     self.assertEqual('hello\\"',
                      docformatter.strip_docstring('"hello\\""'))
Ejemplo n.º 13
0
 def test_strip_docstring_with_escaped_quotes(self):
     self.assertEqual("hello\\'",
                      docformatter.strip_docstring("'hello\\''"))
Ejemplo n.º 14
0
 def test_strip_docstring_with_empty_string(self):
     self.assertEqual('', docformatter.strip_docstring('""""""'))