mirror of
https://github.com/mirror/wget.git
synced 2025-01-27 12:50:13 +08:00
Print diff when file contents don't match
This commit is contained in:
parent
b6f9efe7b5
commit
48644f174e
@ -1,3 +1,8 @@
|
||||
2013-09-06 Darshit Shah <darnir@gmail.com>
|
||||
|
||||
* WgetTest.py (CommonMethods.__check_downloaded_files): Print a
|
||||
unified diff in case there is a mismatch in the file contents
|
||||
|
||||
2013-09-06 Darshit Shah <darnir@gmail.com>
|
||||
|
||||
* HTTPServer.py (WgetHTTPRequestHandler.test_cookies): Comment out the
|
||||
|
@ -8,6 +8,7 @@ import http.client
|
||||
import re
|
||||
from subprocess import call
|
||||
from ColourTerm import printer
|
||||
from difflib import unified_diff
|
||||
|
||||
""" A Custom Exception raised by the Test Environment. """
|
||||
|
||||
@ -92,6 +93,8 @@ class CommonMethods:
|
||||
if files.name in local_filesys:
|
||||
local_file = local_filesys.pop (files.name)
|
||||
if files.content != local_file ['content']:
|
||||
for line in unified_diff (local_file['content'], files.content, fromfile="Actual", tofile="Expected"):
|
||||
sys.stderr.write (line)
|
||||
raise TestFailed ("Contents of " + files.name + " do not match")
|
||||
else:
|
||||
raise TestFailed ("Expected file " + files.name + " not found")
|
||||
|
Loading…
Reference in New Issue
Block a user