def test_split_summary_and_description_with_quote(self):
        self.assertEqual(('This is the first\n"one".', ''),
                         docformatter.split_summary_and_description(
                             'This is the first\n"one".'))

        self.assertEqual(("This is the first\n'one'.", ''),
                         docformatter.split_summary_and_description(
                             "This is the first\n'one'."))

        self.assertEqual(('This is the first\n``one``.', ''),
                         docformatter.split_summary_and_description(
                             'This is the first\n``one``.'))
Exemple #2
0
    def test_split_summary_and_description_with_quote(self):
        self.assertEqual(('This is the first\n"one".', ''),
                         docformatter.split_summary_and_description(
                             'This is the first\n"one".'))

        self.assertEqual(("This is the first\n'one'.", ''),
                         docformatter.split_summary_and_description(
                             "This is the first\n'one'."))

        self.assertEqual(('This is the first\n``one``.', ''),
                         docformatter.split_summary_and_description(
                             'This is the first\n``one``.'))
Exemple #3
0
    def test_split_summary_and_description_with_list_on_other_line(self):
        self.assertEqual(('Test\n    test', '    @blah'),
                         docformatter.split_summary_and_description('''\
    Test
    test
    @blah
'''))
    def test_split_summary_and_description_with_list_on_other_line(self):
        self.assertEqual(('Test\n    test', '    @blah'),
                         docformatter.split_summary_and_description('''\
    Test
    test
    @blah
'''))
 def test_split_summary_and_description_with_abbreviation(self):
     for text in [
             'Test e.g. now'
             'Test i.e. now', 'Test Dr. now', 'Test Mr. now',
             'Test Mrs. now', 'Test Ms. now'
     ]:
         self.assertEqual((text, ''),
                          docformatter.split_summary_and_description(text))
Exemple #6
0
 def test_split_summary_and_description_with_abbreviation(self):
     for text in ['Test e.g. now'
                  'Test i.e. now',
                  'Test Dr. now',
                  'Test Mr. now',
                  'Test Mrs. now',
                  'Test Ms. now']:
         self.assertEqual(
             (text, ''),
             docformatter.split_summary_and_description(text))
    def test_split_summary_and_description_without__punctuation(self):
        self.assertEqual(("""\
Try this and this and this and this and this and this and this at
    this other line""", """
    Parameters
    ----------
    email : string"""),
                         docformatter.split_summary_and_description('''\
    Try this and this and this and this and this and this and this at
    this other line

    Parameters
    ----------
    email : string
'''))
    def test_split_summary_and_description_with_late__punctuation(self):
        self.assertEqual(("""\
Try this and this and this and this and this and this and this at
    http://example.com/""", """
    Parameters
    ----------
    email : string"""),
                         docformatter.split_summary_and_description('''\
    Try this and this and this and this and this and this and this at
    http://example.com/

    Parameters
    ----------
    email : string
'''))
Exemple #9
0
    def test_split_summary_and_description_without__punctuation(self):
        self.assertEqual(
            ("""\
Try this and this and this and this and this and this and this at
    this other line""",
             """
    Parameters
    ----------
    email : string"""),
            docformatter.split_summary_and_description('''\
    Try this and this and this and this and this and this and this at
    this other line

    Parameters
    ----------
    email : string
'''))
Exemple #10
0
    def test_split_summary_and_description_with_late__punctuation(self):
        self.assertEqual(
            ("""\
Try this and this and this and this and this and this and this at
    http://example.com/""",
             """
    Parameters
    ----------
    email : string"""),
            docformatter.split_summary_and_description('''\
    Try this and this and this and this and this and this and this at
    http://example.com/

    Parameters
    ----------
    email : string
'''))
Exemple #11
0
 def test_split_summary_and_description_more_complex(self):
     self.assertEqual(
         ('This is the first.',
          'This is the second. This is the third.'),
         docformatter.split_summary_and_description(
             'This is the first.\nThis is the second. This is the third.'))
Exemple #12
0
 def test_split_summary_and_description_with_list_of_parameters(self):
     self.assertEqual(('This is the first',
                       'one - one\ntwo - two'),
                      docformatter.split_summary_and_description(
                          'This is the first\none - one\ntwo - two'))
 def test_split_summary_and_description_with_question_mark(self):
     self.assertEqual(('This is the first?', 'one\ntwo'),
                      docformatter.split_summary_and_description(
                          'This is the first?\none\ntwo'))
 def test_split_summary_and_description_with_exclamation(self):
     self.assertEqual(('This is the first!', 'one\ntwo'),
                      docformatter.split_summary_and_description(
                          'This is the first!\none\ntwo'))
 def test_split_summary_and_description_with_other_symbol(self):
     self.assertEqual(('This is the first', '@ one\n@ two'),
                      docformatter.split_summary_and_description(
                          'This is the first\n@ one\n@ two'))
Exemple #16
0
 def test_split_summary_and_description_with_capital(self):
     self.assertEqual(('This is the first\nWashington', ''),
                      docformatter.split_summary_and_description(
                          'This is the first\nWashington'))
 def test_split_summary_and_description_with_capital(self):
     self.assertEqual(('This is the first\nWashington', ''),
                      docformatter.split_summary_and_description(
                          'This is the first\nWashington'))
 def test_split_summary_and_description_with_list_of_parameters(self):
     self.assertEqual(('This is the first', 'one - one\ntwo - two'),
                      docformatter.split_summary_and_description(
                          'This is the first\none - one\ntwo - two'))
 def test_split_summary_and_description_with_list(self):
     self.assertEqual(('This is the first', '- one\n- two'),
                      docformatter.split_summary_and_description(
                          'This is the first\n- one\n- two'))
 def test_split_summary_and_description_more_complex(self):
     self.assertEqual(
         ('This is the first.', 'This is the second. This is the third.'),
         docformatter.split_summary_and_description(
             'This is the first.\nThis is the second. This is the third.'))
Exemple #21
0
 def test_split_summary_and_description_with_other_symbol(self):
     self.assertEqual(('This is the first',
                       '@ one\n@ two'),
                      docformatter.split_summary_and_description(
                          'This is the first\n@ one\n@ two'))
Exemple #22
0
 def test_split_summary_and_description_with_list(self):
     self.assertEqual(('This is the first',
                       '- one\n- two'),
                      docformatter.split_summary_and_description(
                          'This is the first\n- one\n- two'))
Exemple #23
0
 def test_split_summary_and_description_with_exclamation(self):
     self.assertEqual(('This is the first!',
                       'one\ntwo'),
                      docformatter.split_summary_and_description(
                          'This is the first!\none\ntwo'))
Exemple #24
0
 def test_split_summary_and_description_with_question_mark(self):
     self.assertEqual(('This is the first?',
                       'one\ntwo'),
                      docformatter.split_summary_and_description(
                          'This is the first?\none\ntwo'))