aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2017-02-11 01:45:14 +0100
committerGitHub <noreply@github.com>2017-02-11 01:45:14 +0100
commit71742654e3cab347378509f559dc14399b4eb65e (patch)
tree538f40a31be7ae9f28a71fb4902d89d1b8ad5ab8 /test
parentd4593bc333864d4175caae1b3786e643a2602327 (diff)
parent809207195d9b4fe7b1f33f7bea8efa05a8895d56 (diff)
downloadmitmproxy-71742654e3cab347378509f559dc14399b4eb65e.tar.gz
mitmproxy-71742654e3cab347378509f559dc14399b4eb65e.tar.bz2
mitmproxy-71742654e3cab347378509f559dc14399b4eb65e.zip
Merge pull request #2005 from ujjwal96/script-reload
Closes #1828 script reloads on py file changes
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/addons/test_script.py7
1 files changed, 6 insertions, 1 deletions
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