From 809207195d9b4fe7b1f33f7bea8efa05a8895d56 Mon Sep 17 00:00:00 2001 From: Ujjwal Verma Date: Fri, 10 Feb 2017 20:53:28 +0530 Subject: closes #1828 script reloads on py file changes --- test/mitmproxy/addons/test_script.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/mitmproxy/addons/test_script.py b/test/mitmproxy/addons/test_script.py index 96d7bd9e..5f196ebf 100644 --- a/test/mitmproxy/addons/test_script.py +++ b/test/mitmproxy/addons/test_script.py @@ -44,14 +44,19 @@ def test_reloadhandler(): rh = script.ReloadHandler(Called()) assert not rh.filter(watchdog.events.DirCreatedEvent("path")) assert not rh.filter(watchdog.events.FileModifiedEvent("/foo/.bar")) - assert rh.filter(watchdog.events.FileModifiedEvent("/foo/bar")) + assert not rh.filter(watchdog.events.FileModifiedEvent("/foo/bar")) + assert rh.filter(watchdog.events.FileModifiedEvent("/foo/bar.py")) assert not rh.callback.called rh.on_modified(watchdog.events.FileModifiedEvent("/foo/bar")) + assert not rh.callback.called + rh.on_modified(watchdog.events.FileModifiedEvent("/foo/bar.py")) assert rh.callback.called rh.callback.called = False rh.on_created(watchdog.events.FileCreatedEvent("foo")) + assert not rh.callback.called + rh.on_created(watchdog.events.FileCreatedEvent("foo.py")) assert rh.callback.called -- cgit v1.2.3