예제 #1
0
    def test_docstring_args(self):
        """
        Test _docstring_args return dict with docstring param as ReStructuredText.
        """
        args = ArgParser._docstring_args(
            """
            Test docstring.

            :param str test: test string.
            :param str test2: second test string.
            """
        )
        self.assertEqual(
            {'test': 'test string.', 'test2': 'second test string.'}, args
        )
예제 #2
0
 def test_docstring_args_with_none(self):
     """
     Test _docstring_args with None (no docstring in function).
     """
     args = ArgParser._docstring_args(None)
     self.assertEqual({}, args)
예제 #3
0
 def test_docstring_args_with_empty_string(self):
     """
     Test _docstring_args with an empty docstring.
     """
     args = ArgParser._docstring_args("")
     self.assertEqual({}, args)