Skip to content

Commit

Permalink
added test for to check for duplicate descendants
Browse files Browse the repository at this point in the history
  • Loading branch information
jesicasusanto committed Jun 5, 2023
1 parent 40ed70b commit fe0c267
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/openadapt/test_windows.py
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

0 comments on commit fe0c267

Please sign in to comment.