From b44e4a81bf872bec5a3bbe4d281630d146f3cd32 Mon Sep 17 00:00:00 2001 From: Adel Daouzli Date: Mon, 8 Mar 2021 16:27:42 +0100 Subject: [PATCH] add/update tests as issue #69 is fixed thanks to issue #93 (and PR #96) --- CHANGELOG | 3 ++- tests/issue69.py | 3 +++ tests/issue69.py.patch | 13 +++++++++++++ tests/test_issues.py | 10 ++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 tests/issue69.py create mode 100644 tests/issue69.py.patch diff --git a/CHANGELOG b/CHANGELOG index c3b8cd8..4f4fe6e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ 0.4.0: - add support to type hints (PEP 484) - - issues #46, #93 + - issues #46, #69, #93 + - integrate PRs #96 0.3.4 - 2021/03/04: - manage async functions diff --git a/tests/issue69.py b/tests/issue69.py new file mode 100644 index 0000000..41ac412 --- /dev/null +++ b/tests/issue69.py @@ -0,0 +1,3 @@ +def plot_outlier(inlier, outlier, outlier_rgb = [1, 0, 0]): + """Plot the outlier of ...""" + pass diff --git a/tests/issue69.py.patch b/tests/issue69.py.patch new file mode 100644 index 0000000..557b711 --- /dev/null +++ b/tests/issue69.py.patch @@ -0,0 +1,13 @@ +--- a/issue69.py ++++ b/issue69.py +@@ -1,3 +1,9 @@ + def plot_outlier(inlier, outlier, outlier_rgb = [1, 0, 0]): +- """Plot the outlier of ...""" ++ """Plot the outlier of ... ++ ++ :param inlier: ++ :param outlier: ++ :param outlier_rgb: (Default value = [1, 0, 0]) ++ ++ """ + pass diff --git a/tests/test_issues.py b/tests/test_issues.py index b9d53aa..678ed43 100644 --- a/tests/test_issues.py +++ b/tests/test_issues.py @@ -226,6 +226,16 @@ def func(param): # some comment result = ''.join(p.diff()) self.assertTrue(result == expected) + def testIssue69(self): + # Title: Wrong Formatting for Input params with default values + # When default value has a list it is split and considers list's elements as parameters + p = pym.PyComment(absdir('issue69.py')) + p._parse() + f = open(absdir('issue69.py.patch')) + patch = f.read() + f.close() + self.assertEqual(''.join(p.diff()), patch) + def testIssue88(self): # Title: Not working on async functions # The async functions are not managed