summaryrefslogtreecommitdiff
path: root/crocoite/test_controller.py
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2019-05-30 14:51:11 +0300
committerLars-Dominik Braun <lars@6xq.net>2019-05-30 14:52:48 +0300
commit6067fa02b8252c3e084a9d9b0cd122ec217e5ee7 (patch)
treee84ab7bd96beb46e9f2b8fc97838d7ef6143f30a /crocoite/test_controller.py
parent79d9adf23e9993ae36ad9a89108ab79eec32882a (diff)
downloadcrocoite-6067fa02b8252c3e084a9d9b0cd122ec217e5ee7.tar.gz
crocoite-6067fa02b8252c3e084a9d9b0cd122ec217e5ee7.tar.bz2
crocoite-6067fa02b8252c3e084a9d9b0cd122ec217e5ee7.zip
controller: Fix DepthLimit
The policy itself must be stateless, since there can be multiple ExtractLinks events (which would cause DepthLimit to reduce its depth every time).
Diffstat (limited to 'crocoite/test_controller.py')
-rw-r--r--crocoite/test_controller.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/crocoite/test_controller.py b/crocoite/test_controller.py
index c88b80d..6f92e23 100644
--- a/crocoite/test_controller.py
+++ b/crocoite/test_controller.py
@@ -26,7 +26,7 @@ from aiohttp import web
import pytest
from .logger import Logger
-from .controller import ControllerSettings, SinglePageController
+from .controller import ControllerSettings, SinglePageController, SetEntry
from .devtools import Process
from .test_browser import loader
@@ -104,3 +104,16 @@ window.setInterval (function () { fetch('/').then (function (e) { console.log (e
finally:
await runner.cleanup ()
+def test_set_entry ():
+ a = SetEntry (1, a=2, b=3)
+ assert a == a
+ assert hash (a) == hash (a)
+
+ b = SetEntry (1, a=2, b=4)
+ assert a == b
+ assert hash (a) == hash (b)
+
+ c = SetEntry (2, a=2, b=3)
+ assert a != c
+ assert hash (a) != hash (c)
+