#!/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):
        sys.stdout = open(os.devnull, 'w')

    def test_scaled_object(self):
        "Object in the defs with 50,50 scaled by 0.5 when used"
        args = [ 'svg/simpletransform.test.svg' ]
        e = Effect()
        e.affect(args, False)
        bbox = computeBBox(e.selected.values())
        text_bbox = "{} {} {} {}".format(bbox[0], bbox[1], bbox[2], bbox[3])
        print(text_bbox)



if __name__ == '__main__':
    suite = unittest.TestLoader().loadTestsFromTestCase(ComputeBBoxTest)
    unittest.TextTestRunner(verbosity=2).run(suite)
