Skip to content

Commit

Permalink
feat: test
Browse files Browse the repository at this point in the history
  • Loading branch information
CristiFati committed Mar 23, 2024
1 parent d7db5ea commit 5ba81d9
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions win32/test/test_win32gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,55 @@ def test_enumchildwindows(self):
TypeError, win32gui.EnumChildWindows, None, func, data
)

def test_enumdesktopwindows(self):
win32api.SetLastError(0)
desktop = None
for data in (0, False):
self.assertRaises(
pywintypes.error,
win32gui.EnumDesktopWindows,
desktop,
self.enum_callback_sle,
data,
)
for data in (None, 1, True):
self.assertIsNone(
win32gui.EnumDesktopWindows(desktop, self.enum_callback_sle, data)
)
win32api.SetLastError(0)
for data in self.default_data_set:
self.assertIsNone(
win32gui.EnumDesktopWindows(desktop, self.enum_callback, data)
)
for data in self.default_data_set:
self.assertRaises(
ValueError,
win32gui.EnumDesktopWindows,
desktop,
self.enum_callback_exc,
data,
)
desktops = (0, None)
for desktop in desktops:
for data in self.default_data_set:
self.assertRaises(
ValueError,
win32gui.EnumDesktopWindows,
desktop,
self.enum_callback_exc,
data,
)
if sys.version_info[:2] >= (3, 10):
for func in (
self.enum_callback,
self.enum_callback_sle,
):
for desktop in desktops:
for data in self.type_data_set:
self.assertRaises(
TypeError, win32gui.EnumDesktopWindows, 0, func, data
)


if __name__ == "__main__":
unittest.main()

0 comments on commit 5ba81d9

Please sign in to comment.