diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-05-01 14:05:43 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-05-01 14:06:18 +0200 |
commit | f69b2c1e24c711c7451a93cc30a317c113b09d6a (patch) | |
tree | 4652c6e3792bf1146a704927c0d106ecab8b69eb /test | |
parent | e110cc9eb66a5f1bc40a2f8864bd9977e614c5ad (diff) |
add testcase for fdo31814-2.emf
Diffstat (limited to 'test')
-rw-r--r-- | test/emf/pass/fdo31814-2.emf | bin | 0 -> 15996 bytes | |||
-rwxr-xr-x | test/emf/test.py | 46 |
2 files changed, 46 insertions, 0 deletions
diff --git a/test/emf/pass/fdo31814-2.emf b/test/emf/pass/fdo31814-2.emf Binary files differnew file mode 100644 index 0000000..8b3923e --- /dev/null +++ b/test/emf/pass/fdo31814-2.emf diff --git a/test/emf/test.py b/test/emf/test.py new file mode 100755 index 0000000..c4091f5 --- /dev/null +++ b/test/emf/test.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python2 +# -*- encoding: UTF-8 -*- +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +import sys +sys.path.append(sys.path[0] + "/../..") +emf_dumper = __import__('emf-dump') +from xml.etree import ElementTree +import unittest +import os + + +class Test(unittest.TestCase): + def dump(self, name): + try: + os.unlink("%s.emf.xml" % name) + except OSError: + pass + sock = open("%s.emf.xml" % name, "w") + saved = sys.stdout + sys.stdout = sock + emf_dumper.main(["emf-dumper", "%s.emf" % name]) + sys.stdout = saved + sock.close() + tree = ElementTree.parse('%s.emf.xml' % name) + self.root = tree.getroot() + # Make sure everything is dumped - so it can't happen that dump(a) == dump(b), but a != b. + self.assertEqual(0, len(self.root.findall('todo'))) + + def test_pass(self): + """This test just makes sure that all files in the 'pass' directory are + dumped without problems.""" + + for dirname, dirnames, filenames in os.walk('pass'): + for filename in filenames: + if filename.endswith(".emf"): + self.dump(os.path.join(dirname, filename).replace('.emf', '')) + +if __name__ == '__main__': + unittest.main() + +# vim:set filetype=python shiftwidth=4 softtabstop=4 expandtab: |