MCPcopy Index your code
hub / github.com/python/cpython / test_keys

Method test_keys

Lib/test/test_tkinter/widget_tests.py:209–232  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

207
208
209 def test_keys(self):
210 widget = self.create()
211 keys = widget.keys()
212 self.assertEqual(sorted(keys), sorted(widget.configure()))
213 for k in keys:
214 widget[k]
215 # Test if OPTIONS contains all keys
216 if test.support.verbose:
217 aliases = {
218 'bd': 'borderwidth',
219 'bg': 'background',
220 'bgimg': 'backgroundimage',
221 'fg': 'foreground',
222 'invcmd': 'invalidcommand',
223 'vcmd': 'validatecommand',
224 }
225 keys = set(keys)
226 expected = set(self.OPTIONS)
227 for k in sorted(keys - expected):
228 if not (k in aliases and
229 aliases[k] in keys and
230 aliases[k] in expected):
231 print('%s.OPTIONS doesn\'t contain "%s"' %
232 (self.__class__.__name__, k))
233
234class PixelOptionsTests:
235 """Standard options that accept all formats acceptable to Tk_GetPixels.

Callers

nothing calls this directly

Calls 5

setFunction · 0.85
createMethod · 0.45
keysMethod · 0.45
assertEqualMethod · 0.45
configureMethod · 0.45

Tested by

no test coverage detected