summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Domonkos <mdomonko@redhat.com>2019-05-21 14:36:36 +0200
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>2019-05-21 11:32:23 -0400
commit2bdf588a20ee9d9175fb27a819d479284b7e5079 (patch)
treeb6c6660ea07a504182fe02176602a9df6dd6162e
parentc696255c5f50341688d718b3547efb1a9971927b (diff)
downloadurlgrabber-2bdf588a20ee9d9175fb27a819d479284b7e5079.tar.gz
test: handle unknown file content in test_retry_no_cache
-rw-r--r--test/test_mirror.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/test_mirror.py b/test/test_mirror.py
index 66cafd0..a175977 100644
--- a/test/test_mirror.py
+++ b/test/test_mirror.py
@@ -352,11 +352,16 @@ class HttpReplyCode(TestCase):
def checkfunc_read(obj):
if obj.data == b'version1':
raise URLGrabError(-1, 'Outdated version of foo')
+ elif obj.data != b'version2':
+ self.fail('Unexpected file content')
def checkfunc_grab(obj):
with open('foo') as f:
- if f.read() == 'version1':
+ data = f.read()
+ if data == 'version1':
raise URLGrabError(-1, 'Outdated version of foo')
+ elif data != 'version2':
+ self.fail('Unexpected file content')
self.process = process
self.reply = 200, b'OK'