forked from docs/doc-exports
Improve comparison
Reviewed-by: Goncharov, Artem <artem.goncharov@t-systems.com> Co-authored-by: gtema <artem.goncharov@gmail.com> Co-committed-by: gtema <artem.goncharov@gmail.com>
This commit is contained in:
parent
2c9359c16c
commit
02ea98d597
@ -35,9 +35,15 @@ class OTCComparator:
|
||||
t1 = original.find(body_filter)
|
||||
t2 = new.find(body_filter)
|
||||
if t1 != t2:
|
||||
logging.error("Content mismatch")
|
||||
return False
|
||||
logging.info("Content matches")
|
||||
if t1.get_text() != t2.get_text():
|
||||
logging.error(
|
||||
"File %s is not matching, but "
|
||||
"plain text matches" % file_name)
|
||||
return False
|
||||
else:
|
||||
logging.error("File %s mismatches" % file_name)
|
||||
else:
|
||||
logging.info("Content matches")
|
||||
return True
|
||||
except Exception as ex:
|
||||
logging.error("Content comparison error %s" % ex)
|
||||
|
Loading…
x
Reference in New Issue
Block a user