From 6067fa02b8252c3e084a9d9b0cd122ec217e5ee7 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Thu, 30 May 2019 14:51:11 +0300 Subject: 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). --- crocoite/test_controller.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'crocoite/test_controller.py') 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) + -- cgit v1.2.3