Skip to content

Commit

Permalink
add tests for detect hidden windows
Browse files Browse the repository at this point in the history
  • Loading branch information
spyoungtech committed Apr 3, 2024
1 parent 9bbbc14 commit 737a3ad
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/_async/test_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@ async def test_set_detect_hidden_windows(self):
all_windows = await self.ahk.list_windows()
assert len(all_windows) > len(non_hidden)

async def test_detect_hidden_windows_false_works(self):
await ahk.set_detect_hidden_windows(True)
all_windows = await ahk.list_windows()
await ahk.set_detect_hidden_windows(False)
non_hidden = await self.ahk.list_windows()
assert len(non_hidden) < len(all_windows)

async def test_list_windows_hidden_false(self):
non_hidden = await ahk.list_windows()
all_windows = await ahk.list_windows(detect_hidden_windows=False)
assert len(non_hidden) == len(all_windows)

async def test_list_windows_hidden(self):
non_hidden = await self.ahk.list_windows()
all_windows = await self.ahk.list_windows(detect_hidden_windows=True)
Expand Down
12 changes: 12 additions & 0 deletions tests/_sync/test_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@ def test_set_detect_hidden_windows(self):
all_windows = self.ahk.list_windows()
assert len(all_windows) > len(non_hidden)

def test_detect_hidden_windows_false_works(self):
ahk.set_detect_hidden_windows(True)
all_windows = ahk.list_windows()
ahk.set_detect_hidden_windows(False)
non_hidden = self.ahk.list_windows()
assert len(non_hidden) < len(all_windows)

def test_list_windows_hidden_false(self):
non_hidden = ahk.list_windows()
all_windows = ahk.list_windows(detect_hidden_windows=False)
assert len(non_hidden) == len(all_windows)

def test_list_windows_hidden(self):
non_hidden = self.ahk.list_windows()
all_windows = self.ahk.list_windows(detect_hidden_windows=True)
Expand Down

0 comments on commit 737a3ad

Please sign in to comment.