pywinauto/Branches/OriginalPydlgChecks/tests/comparetoreffont.py
2006-01-04 19:40:23 +00:00

31 lines
567 B
Python

import win32structures
def CompareToRefFontTest(windows):
bugs = []
for win in windows:
if not win.ref:
continue
diffs = {}
for f in win32structures.LOGFONTW._fields_:
loc = getattr(win.Font, f[0])
ref = getattr(win.ref.Font, f[0])
if loc != ref:
diffs.append(f[0], loc, ref)
for diff, locVal, refVal in diffs.items():
bugs.append((
[win, ],
{
"ValueType": diff,
"Ref": unicode(refVal),
"Loc": unicode(locVal),
},
"CompareToRefFont",
0,)
)
return bugs