diff options
author | Michal Domonkos <mdomonko@redhat.com> | 2019-05-21 14:36:36 +0200 |
---|---|---|
committer | Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com> | 2019-05-21 11:32:23 -0400 |
commit | 2bdf588a20ee9d9175fb27a819d479284b7e5079 (patch) | |
tree | b6c6660ea07a504182fe02176602a9df6dd6162e | |
parent | c696255c5f50341688d718b3547efb1a9971927b (diff) | |
download | urlgrabber-2bdf588a20ee9d9175fb27a819d479284b7e5079.tar.gz |
test: handle unknown file content in test_retry_no_cache
-rw-r--r-- | test/test_mirror.py | 7 |
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' |