-
-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test for to check for duplicate descendants
- Loading branch information
1 parent
40ed70b
commit fe0c267
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from openadapt.window._windows import get_active_window,get_descendants_info | ||
def test_check_duplicates(): | ||
active_window = get_active_window() | ||
result = get_descendants_info(active_window) | ||
unique_props = [] | ||
for item in result: | ||
if isinstance(item, dict): | ||
if item in unique_props: | ||
import ipdb; ipdb.set_trace() | ||
return False # Found a duplicate, return False | ||
unique_props.append(item) | ||
else: | ||
return False # Invalid item, not a dictionary | ||
return True # No duplicates |