Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
cfa8950a
Kaydet (Commit)
cfa8950a
authored
Tem 15, 2014
tarafından
Terry Jan Reedy
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #21982: Add minimal unittest for configDialog with 46% coverage.
Fix regression that this test would have caught.
üst
1cae9ec9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
4 deletions
+42
-4
configDialog.py
Lib/idlelib/configDialog.py
+10
-4
test_configdialog.py
Lib/idlelib/idle_test/test_configdialog.py
+32
-0
No files found.
Lib/idlelib/configDialog.py
Dosyayı görüntüle @
cfa8950a
...
...
@@ -24,9 +24,10 @@ from idlelib import macosxSupport
class
ConfigDialog
(
Toplevel
):
def
__init__
(
self
,
parent
,
title
,
_h
test
=
False
):
def
__init__
(
self
,
parent
,
title
,
_htest
=
False
,
_u
test
=
False
):
"""
_htest - bool, change box location when running htest
_utest - bool, don't wait_window when running unittest
"""
Toplevel
.
__init__
(
self
,
parent
)
self
.
wm_withdraw
()
...
...
@@ -69,8 +70,9 @@ class ConfigDialog(Toplevel):
self
.
LoadConfigs
()
self
.
AttachVarCallbacks
()
#avoid callbacks during LoadConfigs
self
.
wm_deiconify
()
self
.
wait_window
()
if
not
_utest
:
self
.
wm_deiconify
()
self
.
wait_window
()
def
CreateWidgets
(
self
):
self
.
tabPages
=
TabbedPageSet
(
self
,
...
...
@@ -678,7 +680,7 @@ class ConfigDialog(Toplevel):
if
self
.
listBindings
.
curselection
():
reselect
=
1
listIndex
=
self
.
listBindings
.
index
(
ANCHOR
)
# keySet=idleConf.GetKeySet(keySetName) # unused, delete?
keySet
=
idleConf
.
GetKeySet
(
keySetName
)
bindNames
=
list
(
keySet
.
keys
())
bindNames
.
sort
()
self
.
listBindings
.
delete
(
0
,
END
)
...
...
@@ -1144,5 +1146,9 @@ class ConfigDialog(Toplevel):
pass
if
__name__
==
'__main__'
:
import
unittest
unittest
.
main
(
'idlelib.idle_test.test_configdialog'
,
verbosity
=
2
,
exit
=
False
)
from
idlelib.idle_test.htest
import
run
run
(
ConfigDialog
)
Lib/idlelib/idle_test/test_configdialog.py
0 → 100644
Dosyayı görüntüle @
cfa8950a
'''Unittests for idlelib/configHandler.py
Coverage: 46
%
just by creating dialog. The other half is change code.
'''
import
unittest
from
test.support
import
requires
from
tkinter
import
Tk
from
idlelib.configDialog
import
ConfigDialog
from
idlelib.macosxSupport
import
_initializeTkVariantTests
class
ConfigDialogTest
(
unittest
.
TestCase
):
@classmethod
def
setUpClass
(
cls
):
requires
(
'gui'
)
cls
.
root
=
Tk
()
_initializeTkVariantTests
(
cls
.
root
)
@classmethod
def
tearDownClass
(
cls
):
cls
.
root
.
destroy
()
del
cls
.
root
def
test_dialog
(
self
):
d
=
ConfigDialog
(
self
.
root
,
'Test'
,
_utest
=
True
)
d
.
destroy
()
if
__name__
==
'__main__'
:
unittest
.
main
(
verbosity
=
2
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment