summaryrefslogtreecommitdiff
path: root/crocoite/test_behavior.py
diff options
context:
space:
mode:
Diffstat (limited to 'crocoite/test_behavior.py')
-rw-r--r--crocoite/test_behavior.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/crocoite/test_behavior.py b/crocoite/test_behavior.py
index 7a723c6..9a13c65 100644
--- a/crocoite/test_behavior.py
+++ b/crocoite/test_behavior.py
@@ -30,7 +30,7 @@ import pkg_resources
from .logger import Logger
from .devtools import Process
from .behavior import Scroll, Behavior, ExtractLinks, ExtractLinksEvent, Crash, \
- Screenshot, ScreenshotEvent, DomSnapshot, DomSnapshotEvent
+ Screenshot, ScreenshotEvent, DomSnapshot, DomSnapshotEvent, mapOrIgnore
from .controller import SinglePageController, EventHandler
from .devtools import Crashed
@@ -139,6 +139,7 @@ async def test_extract_links ():
<a href="http://example.com/absolute/">foo</a>
<a href="https://example.com/absolute/secure">foo</a>
<a href="#anchor">foo</a>
+ <a href="http://neue_preise_f%c3%bcr_zahnimplantate_k%c3%b6nnten_sie_%c3%bcberraschen">foo</a>
<a href="/hidden/visibility" style="visibility: hidden">foo</a>
<a href="/hidden/display" style="display: none">foo</a>
@@ -252,3 +253,11 @@ async def test_dom_snapshot ():
finally:
await runner.cleanup ()
+def test_mapOrIgnore ():
+ def fail (x):
+ if x < 50:
+ raise Exception ()
+ return x+1
+
+ assert list (mapOrIgnore (fail, range (100))) == list (range (51, 101))
+