[pitivi] dogtail tests: Allow import_media to handle empty search results better
- From: Jean-François Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] dogtail tests: Allow import_media to handle empty search results better
- Date: Fri, 6 Sep 2013 00:13:20 +0000 (UTC)
commit db6bd60460873699188ed37b91615a2557e72633
Author: Jean-François Fortin Tam <nekohayo gmail com>
Date: Wed Aug 21 14:44:16 2013 -0400
dogtail tests: Allow import_media to handle empty search results better
tests/dogtail_scripts/helper_functions.py | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/tests/dogtail_scripts/helper_functions.py b/tests/dogtail_scripts/helper_functions.py
index 086f580..302e596 100644
--- a/tests/dogtail_scripts/helper_functions.py
+++ b/tests/dogtail_scripts/helper_functions.py
@@ -106,11 +106,18 @@ class HelpFunc(BaseDogTail):
for i in range(5):
# The time it takes for the icon to appear is unpredictable,
# therefore we try up to 5 times to look for it
- icons = self.medialibrary.findChildren(GenericPredicate(roleName="icon"))
+ try:
+ icons = self.medialibrary.findChildren(GenericPredicate(roleName="icon"))
+ except TypeError:
+ # If no icon can be seen due to restrictive search results,
+ # don't try to loop over "icons" (which will be a None type).
+ # See further below for further checks that verify this.
+ continue
for icon in icons:
if icon.text == filename:
return icon
sleep(0.5)
+
# Failure to find an icon might be because it is hidden due to a search
current_search_text = self.medialibrary.child(name="media_search_entry",
roleName="text").text.lower()
self.assertNotEqual(current_search_text, "")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]