/usr/lib/python2.7/dist-packages/openpyxl/tests/helper.py is in python-openpyxl 2.3.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
# Python stdlib imports
from lxml.doctestcompare import LXMLOutputChecker, PARSE_XML
def compare_xml(generated, expected):
"""Use doctest checking from lxml for comparing XML trees. Returns diff if the two are not the same"""
checker = LXMLOutputChecker()
class DummyDocTest():
pass
ob = DummyDocTest()
ob.want = expected
check = checker.check_output(expected, generated, PARSE_XML)
if check is False:
diff = checker.output_difference(ob, generated, PARSE_XML)
return diff
|