diff options
| author | Nicolas Dufour <nicoduf@yahoo.fr> | 2017-01-25 17:32:38 +0000 |
|---|---|---|
| committer | JazzyNico <nicoduf@yahoo.fr> | 2017-01-25 17:32:38 +0000 |
| commit | b1597f9bc8bb99fabeaaf4237bff8c24e7062df7 (patch) | |
| tree | 7eb6f548eceea7c22c52cb1284b5fdec83b0a749 /share/extensions/test/simpletransform.test.py | |
| parent | [Bug #1659357] Ukrainian translation update for 0.92.x branch. (diff) | |
| download | inkscape-b1597f9bc8bb99fabeaaf4237bff8c24e7062df7.tar.gz inkscape-b1597f9bc8bb99fabeaaf4237bff8c24e7062df7.zip | |
Extensions. Basic tests for the simpletransform.py file.
(bzr r15450)
Diffstat (limited to 'share/extensions/test/simpletransform.test.py')
| -rwxr-xr-x | share/extensions/test/simpletransform.test.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/share/extensions/test/simpletransform.test.py b/share/extensions/test/simpletransform.test.py new file mode 100755 index 000000000..9e5dbc3b2 --- /dev/null +++ b/share/extensions/test/simpletransform.test.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python + +import os +import sys +import unittest + +sys.path.append('..') # this line allows to import the extension code + +import inkex +from simpletransform import * + +class ComputeBBoxTest(unittest.TestCase): + def setUp(self): + args = [ 'svg/simpletransform.test.svg' ] + self.e = inkex.Effect() + self.e.affect(args, False) + + def test_scaled_object(self): + "Object in the defs with 50,50 scaled by 0.5 when used" + bbox = computeBBox(self.e.document.xpath("//svg:g", namespaces=inkex.NSS)) + text_bbox = "{} {} {} {}".format(bbox[0], bbox[1], bbox[2], bbox[3]) + self.assertEqual(text_bbox, "0.0 25.0 0.0 25.0") + + + +if __name__ == '__main__': + suite = unittest.TestLoader().loadTestsFromTestCase(ComputeBBoxTest) + unittest.TextTestRunner(verbosity=2).run(suite) |
