summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/idle_test/test_query.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-07-21 20:25:43 (GMT)
committerGitHub <noreply@github.com>2019-07-21 20:25:43 (GMT)
commit9325f4091b66f3a9cc85681435367671d335e3e7 (patch)
tree3cc7ce950e9a9bd31ba30474d6b7f482a523702b /Lib/idlelib/idle_test/test_query.py
parenta8cac5762c22120ccbacb6568bba77af2d22b3f7 (diff)
downloadcpython-9325f4091b66f3a9cc85681435367671d335e3e7.zip
cpython-9325f4091b66f3a9cc85681435367671d335e3e7.tar.gz
cpython-9325f4091b66f3a9cc85681435367671d335e3e7.tar.bz2
bpo-37627: Initialize IDLE Custom Run dialog with previous entries (GH-14870)
Repeat the command line arguments most recently entered before so the user can edit them. (cherry picked from commit 35b87e6001bd991f625abe305951c77ddeb9a9c5) Co-authored-by: Ngalim Siregar <ngalim.siregar@gmail.com>
Diffstat (limited to 'Lib/idlelib/idle_test/test_query.py')
-rw-r--r--Lib/idlelib/idle_test/test_query.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/idlelib/idle_test/test_query.py b/Lib/idlelib/idle_test/test_query.py
index 3b444de..f957585 100644
--- a/Lib/idlelib/idle_test/test_query.py
+++ b/Lib/idlelib/idle_test/test_query.py
@@ -12,7 +12,7 @@ HelpSource htests. These are run by running query.py.
from idlelib import query
import unittest
from test.support import requires
-from tkinter import Tk
+from tkinter import Tk, END
import sys
from unittest import mock
@@ -392,10 +392,12 @@ class CustomRunGuiTest(unittest.TestCase):
def test_click_args(self):
root = Tk()
root.withdraw()
- dialog = query.CustomRun(root, 'Title', _utest=True)
- dialog.entry.insert(0, 'okay')
+ dialog = query.CustomRun(root, 'Title',
+ cli_args=['a', 'b=1'], _utest=True)
+ self.assertEqual(dialog.entry.get(), 'a b=1')
+ dialog.entry.insert(END, ' c')
dialog.button_ok.invoke()
- self.assertEqual(dialog.result, (['okay'], True))
+ self.assertEqual(dialog.result, (['a', 'b=1', 'c'], True))
root.destroy()