forked from docs/doc-exports
Ignore spaces in plain text 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
06cd11f857
commit
23543de0cf
@ -13,6 +13,10 @@ def body_filter(tag):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def simplify_body(data):
|
||||||
|
return data.get_text().replace(" ", "")
|
||||||
|
|
||||||
|
|
||||||
class OTCComparator:
|
class OTCComparator:
|
||||||
|
|
||||||
def compare(self, url_prefix, file_path, file_name):
|
def compare(self, url_prefix, file_path, file_name):
|
||||||
@ -35,7 +39,7 @@ class OTCComparator:
|
|||||||
t1 = original.find(body_filter)
|
t1 = original.find(body_filter)
|
||||||
t2 = new.find(body_filter)
|
t2 = new.find(body_filter)
|
||||||
if t1 != t2:
|
if t1 != t2:
|
||||||
if t1.get_text() == t2.get_text():
|
if simplify_body(t1) == simplify_body(t2):
|
||||||
logging.error(
|
logging.error(
|
||||||
"File %s is not matching, but "
|
"File %s is not matching, but "
|
||||||
"plain text matches" % file_name)
|
"plain text matches" % file_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user