From 4a24da8656c0f8cde1646f5377e95ccef45808f3 Mon Sep 17 00:00:00 2001 From: Valentina Kiryushkina Date: Tue, 17 Nov 2015 20:01:06 +0300 Subject: [PATCH] Add tests for authocomplete in formated arguments and formatted strings --- .../completion/formatFuncArgument.after.py | 1 + python/testData/completion/formatFuncArgument.py | 1 + python/testData/completion/formatString.after.py | 1 + python/testData/completion/formatString.py | 1 + .../completion/formatStringFromStarArg.after.py | 1 + .../completion/formatStringFromStarArg.py | 1 + .../formatStringOutsideBraces.after.py | 1 + .../completion/formatStringOutsideBraces.py | 1 + .../jetbrains/python/PythonCompletionTest.java | 16 ++++++++++++++++ 9 files changed, 24 insertions(+) create mode 100644 python/testData/completion/formatFuncArgument.after.py create mode 100644 python/testData/completion/formatFuncArgument.py create mode 100644 python/testData/completion/formatString.after.py create mode 100644 python/testData/completion/formatString.py create mode 100644 python/testData/completion/formatStringFromStarArg.after.py create mode 100644 python/testData/completion/formatStringFromStarArg.py create mode 100644 python/testData/completion/formatStringOutsideBraces.after.py create mode 100644 python/testData/completion/formatStringOutsideBraces.py diff --git a/python/testData/completion/formatFuncArgument.after.py b/python/testData/completion/formatFuncArgument.after.py new file mode 100644 index 000000000000..e22ec9602a1f --- /dev/null +++ b/python/testData/completion/formatFuncArgument.after.py @@ -0,0 +1 @@ +"Yeah you can take me out the {place} But you can’t take the hood up outta me".format(place) \ No newline at end of file diff --git a/python/testData/completion/formatFuncArgument.py b/python/testData/completion/formatFuncArgument.py new file mode 100644 index 000000000000..49ee2962ab13 --- /dev/null +++ b/python/testData/completion/formatFuncArgument.py @@ -0,0 +1 @@ +"Yeah you can take me out the {place} But you can’t take the hood up outta me".format(pla) \ No newline at end of file diff --git a/python/testData/completion/formatString.after.py b/python/testData/completion/formatString.after.py new file mode 100644 index 000000000000..58f3b6a51e14 --- /dev/null +++ b/python/testData/completion/formatString.after.py @@ -0,0 +1 @@ +"Yeah you can take me out the {place} But you can’t take the hood up outta me".format(place="hood") \ No newline at end of file diff --git a/python/testData/completion/formatString.py b/python/testData/completion/formatString.py new file mode 100644 index 000000000000..78fb6b3bd515 --- /dev/null +++ b/python/testData/completion/formatString.py @@ -0,0 +1 @@ +"Yeah you can take me out the {pla} But you can’t take the hood up outta me".format(place="hood") \ No newline at end of file diff --git a/python/testData/completion/formatStringFromStarArg.after.py b/python/testData/completion/formatStringFromStarArg.after.py new file mode 100644 index 000000000000..3f2046687911 --- /dev/null +++ b/python/testData/completion/formatStringFromStarArg.after.py @@ -0,0 +1 @@ +"Yeah you can take me out the {place} But you can’t take the hood up outta me".format(**{"place":"hood"}) \ No newline at end of file diff --git a/python/testData/completion/formatStringFromStarArg.py b/python/testData/completion/formatStringFromStarArg.py new file mode 100644 index 000000000000..6dc680568f64 --- /dev/null +++ b/python/testData/completion/formatStringFromStarArg.py @@ -0,0 +1 @@ +"Yeah you can take me out the {pla} But you can’t take the hood up outta me".format(**{"place":"hood"}) \ No newline at end of file diff --git a/python/testData/completion/formatStringOutsideBraces.after.py b/python/testData/completion/formatStringOutsideBraces.after.py new file mode 100644 index 000000000000..12cec2e5e661 --- /dev/null +++ b/python/testData/completion/formatStringOutsideBraces.after.py @@ -0,0 +1 @@ +"Yeah you can take me out the {hood} But you can’t take the ho up outta me".format(hood="hood") \ No newline at end of file diff --git a/python/testData/completion/formatStringOutsideBraces.py b/python/testData/completion/formatStringOutsideBraces.py new file mode 100644 index 000000000000..454597437e63 --- /dev/null +++ b/python/testData/completion/formatStringOutsideBraces.py @@ -0,0 +1 @@ +"Yeah you can take me out the {hood} But you can’t take the ho up outta me".format(hood="hood") \ No newline at end of file diff --git a/python/testSrc/com/jetbrains/python/PythonCompletionTest.java b/python/testSrc/com/jetbrains/python/PythonCompletionTest.java index 17d933cc9e06..6ca41bc963da 100644 --- a/python/testSrc/com/jetbrains/python/PythonCompletionTest.java +++ b/python/testSrc/com/jetbrains/python/PythonCompletionTest.java @@ -902,6 +902,22 @@ public class PythonCompletionTest extends PyTestCase { doTest(); } + public void testFormatString() { + doTest(); + } + + public void testFormatFuncArgument() { + doTest(); + } + + public void testFormatStringFromStarArg() { + doTest(); + } + + public void testFormatStringOutsideBraces() { + doTest(); + } + @Override protected String getTestDataPath() { return super.getTestDataPath() + "/completion";