From: aurium Date: Mon, 13 Apr 2009 20:05:53 +0000 (+0000) Subject: more basic test files and basic effect corrections X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=83aaf46c9feab529aeb9add871c05c3d1177afcc;p=inkscape.git more basic test files and basic effect corrections --- diff --git a/share/extensions/draw_from_triangle.py b/share/extensions/draw_from_triangle.py index b63d0f556..196bc3c9e 100644 --- a/share/extensions/draw_from_triangle.py +++ b/share/extensions/draw_from_triangle.py @@ -469,6 +469,6 @@ class Draw_From_Triangle(inkex.Effect): draw_SVG_circle(0, isotomic, params, st, 'CustomIsotomicConjugate', layer) -e = Draw_From_Triangle() -e.affect() - +if __name__ == '__main__': #pragma: no cover + e = Draw_From_Triangle() + e.affect() diff --git a/share/extensions/extrude.py b/share/extensions/extrude.py index e1056bdfe..88ad26e49 100644 --- a/share/extensions/extrude.py +++ b/share/extensions/extrude.py @@ -86,7 +86,8 @@ class Extrude(inkex.Effect): ele = inkex.etree.Element('{http://www.w3.org/2000/svg}path') g.append(ele) ele.set('d', simplepath.formatPath(line)) - -e = Extrude() -e.affect() + +if __name__ == '__main__': #pragma: no cover + e = Extrude() + e.affect() diff --git a/share/extensions/foldablebox.py b/share/extensions/foldablebox.py index 242ddcfb8..47f3ad59c 100755 --- a/share/extensions/foldablebox.py +++ b/share/extensions/foldablebox.py @@ -68,7 +68,7 @@ class FoldableBox(inkex.Effect): tabH = boxD * tabProp box_id = self.uniqueId('box') - g = inkex.etree.SubElement(self.current_layer, 'g', {'id':box_id}) + self.box = g = inkex.etree.SubElement(self.current_layer, 'g', {'id':box_id}) line_style = simplestyle.formatStyle({ 'stroke': '#000000', 'fill': 'none' }) @@ -258,7 +258,7 @@ class FoldableBox(inkex.Effect): g.set( 'transform', 'translate(%f,%f)' % ( (docW-left_pos)/2, (docH-lower_pos)/2 ) ) -if __name__ == '__main__': +if __name__ == '__main__': #pragma: no cover e = FoldableBox() e.affect() diff --git a/share/extensions/guides_creator.py b/share/extensions/guides_creator.py index 45fae9352..96f2557ee 100755 --- a/share/extensions/guides_creator.py +++ b/share/extensions/guides_creator.py @@ -223,9 +223,11 @@ class Guides_Creator(inkex.Effect): drawVerticalGuides(v_division,width,height,from_edges,nv) drawHorizontalGuides(h_division,width,height,from_edges,nv) - -# Create effect instance and apply it. -effect = Guides_Creator() -effect.affect() + + +if __name__ == '__main__': #pragma: no cover + # Create effect instance and apply it. + effect = Guides_Creator() + effect.affect() ## end of file guide_creator.py ## diff --git a/share/extensions/hpgl_output.py b/share/extensions/hpgl_output.py index 306fc0e8b..606718995 100644 --- a/share/extensions/hpgl_output.py +++ b/share/extensions/hpgl_output.py @@ -44,5 +44,6 @@ class MyEffect(inkex.Effect): first = False self.hpgl.append('%s%s,%s;' % (cmd,csp[1][0],csp[1][1])) -e = MyEffect() -e.affect() +if __name__ == '__main__': #pragma: no cover + e = MyEffect() + e.affect() diff --git a/share/extensions/svgcalendar.py b/share/extensions/svgcalendar.py index 5f70bc3c6..c5fddd940 100755 --- a/share/extensions/svgcalendar.py +++ b/share/extensions/svgcalendar.py @@ -333,6 +333,6 @@ class SVGCalendar (inkex.Effect): self.create_month(self.options.month) -if __name__ == '__main__': +if __name__ == '__main__': #pragma: no cover e = SVGCalendar() e.affect() diff --git a/share/extensions/test/addnodes.test.py b/share/extensions/test/addnodes.test.py new file mode 100755 index 000000000..a12f1d73c --- /dev/null +++ b/share/extensions/test/addnodes.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../addnodes.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from addnodes import * + +class SplitItBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = SplitIt() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/chardataeffect.test.py b/share/extensions/test/chardataeffect.test.py new file mode 100755 index 000000000..780eef80a --- /dev/null +++ b/share/extensions/test/chardataeffect.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../chardataeffect.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from chardataeffect import * + +class CharDataEffectBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = CharDataEffect() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/coloreffect.test.py b/share/extensions/test/coloreffect.test.py new file mode 100755 index 000000000..61a83713a --- /dev/null +++ b/share/extensions/test/coloreffect.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../coloreffect.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from coloreffect import * + +class ColorEffectBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = ColorEffect() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/create_test_from_template.sh b/share/extensions/test/create_test_from_template.sh index b2884dc19..d424f4b72 100755 --- a/share/extensions/test/create_test_from_template.sh +++ b/share/extensions/test/create_test_from_template.sh @@ -15,6 +15,13 @@ fi module=$( echo "$exFile" | sed -r 's/^.*\/([^\/.]+)..*$/\1/' ) +num=0 +testFile="$module.test.py" +while test -e "$testFile"; do + let num++ + testFile="$module.test$num.py" +done + if grep -q '^\s*class .*[( ]inkex.Effect[ )]' $exFile; then pyClass=$( grep '^\s*class .*[( ]inkex.Effect[ )]' $exFile | sed -r 's/^\s*class\s+([^ ]+)\s*\(.*$/\1/' ) else @@ -22,21 +29,15 @@ else ERROR: Incompatible Format or Inheritance. At this time this script only knows how to make unit tests for Python effects based on inkex.Effect. + The $testFile will not be created. " exit 1 fi -exFileRE="$( echo "$exFile" | sed -r 's/\./\\./g; s/\//\\\//g' )" - -num=0 -testFile="$module.test.py" -while test -e "$testFile"; do - let num++ - testFile="$module.test$num.py" -done - echo ">> Creating $testFile" +exFileRE="$( echo "$exFile" | sed -r 's/\./\\./g; s/\//\\\//g' )" + sed -r "s/%MODULE%/$module/g; s/%CLASS%/$pyClass/g; s/%FILE%/$exFileRE/g" \ test_template.py.txt > "$testFile" diff --git a/share/extensions/test/dots.test.py b/share/extensions/test/dots.test.py new file mode 100755 index 000000000..4f4c3074d --- /dev/null +++ b/share/extensions/test/dots.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../dots.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from dots import * + +class DotsBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Dots() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/draw_from_triangle.test.py b/share/extensions/test/draw_from_triangle.test.py new file mode 100755 index 000000000..c5da0c2a4 --- /dev/null +++ b/share/extensions/test/draw_from_triangle.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../draw_from_triangle.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from draw_from_triangle import * + +class Draw_From_TriangleBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Draw_From_Triangle() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/dxf_outlines.test.py b/share/extensions/test/dxf_outlines.test.py new file mode 100755 index 000000000..5124c5306 --- /dev/null +++ b/share/extensions/test/dxf_outlines.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../dxf_outlines.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from dxf_outlines import * + +class MyEffectBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = MyEffect() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/edge3d.test.py b/share/extensions/test/edge3d.test.py new file mode 100755 index 000000000..93871a4ad --- /dev/null +++ b/share/extensions/test/edge3d.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../edge3d.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from edge3d import * + +class Edge3dBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Edge3d() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/embedimage.test.py b/share/extensions/test/embedimage.test.py new file mode 100755 index 000000000..378c3f045 --- /dev/null +++ b/share/extensions/test/embedimage.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../embedimage.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from embedimage import * + +class EmbedderBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Embedder() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/eqtexsvg.test.py b/share/extensions/test/eqtexsvg.test.py new file mode 100755 index 000000000..2c16cc05c --- /dev/null +++ b/share/extensions/test/eqtexsvg.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../eqtexsvg.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from eqtexsvg import * + +class EQTEXSVGBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = EQTEXSVG() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/extractimage.test.py b/share/extensions/test/extractimage.test.py new file mode 100755 index 000000000..4f00f2075 --- /dev/null +++ b/share/extensions/test/extractimage.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../extractimage.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from extractimage import * + +class MyEffectBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = MyEffect() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/extrude.test.py b/share/extensions/test/extrude.test.py new file mode 100755 index 000000000..21c350e93 --- /dev/null +++ b/share/extensions/test/extrude.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../extrude.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from extrude import * + +class ExtrudeBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Extrude() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/flatten.test.py b/share/extensions/test/flatten.test.py new file mode 100755 index 000000000..fc4459668 --- /dev/null +++ b/share/extensions/test/flatten.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../flatten.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from flatten import * + +class MyEffectBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = MyEffect() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/fractalize.test.py b/share/extensions/test/fractalize.test.py new file mode 100755 index 000000000..c2a99969f --- /dev/null +++ b/share/extensions/test/fractalize.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../fractalize.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from fractalize import * + +class PathFractalizeBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = PathFractalize() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/funcplot.test.py b/share/extensions/test/funcplot.test.py new file mode 100755 index 000000000..daa49a4c8 --- /dev/null +++ b/share/extensions/test/funcplot.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../funcplot.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from funcplot import * + +class FuncPlotBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = FuncPlot() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/gears.test.py b/share/extensions/test/gears.test.py new file mode 100755 index 000000000..964f675ad --- /dev/null +++ b/share/extensions/test/gears.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../gears.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from gears import * + +class GearsBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Gears() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/gimp_xcf.test.py b/share/extensions/test/gimp_xcf.test.py new file mode 100755 index 000000000..ae238f0cf --- /dev/null +++ b/share/extensions/test/gimp_xcf.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../gimp_xcf.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from gimp_xcf import * + +class MyEffectBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = MyEffect() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/grid_cartesian.test.py b/share/extensions/test/grid_cartesian.test.py new file mode 100755 index 000000000..6f5881d4d --- /dev/null +++ b/share/extensions/test/grid_cartesian.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../grid_cartesian.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from grid_cartesian import * + +class Grid_PolarBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Grid_Polar() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/grid_polar.test.py b/share/extensions/test/grid_polar.test.py new file mode 100755 index 000000000..b871e6077 --- /dev/null +++ b/share/extensions/test/grid_polar.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../grid_polar.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from grid_polar import * + +class Grid_PolarBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Grid_Polar() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/guides_creator.test.py b/share/extensions/test/guides_creator.test.py new file mode 100755 index 000000000..d6f97c6c8 --- /dev/null +++ b/share/extensions/test/guides_creator.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../guides_creator.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from guides_creator import * + +class Guides_CreatorBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Guides_Creator() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/handles.test.py b/share/extensions/test/handles.test.py new file mode 100755 index 000000000..69153a403 --- /dev/null +++ b/share/extensions/test/handles.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../handles.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from handles import * + +class HandlesBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Handles() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/hpgl_output.test.py b/share/extensions/test/hpgl_output.test.py new file mode 100755 index 000000000..4d9500b1e --- /dev/null +++ b/share/extensions/test/hpgl_output.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../hpgl_output.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from hpgl_output import * + +class MyEffectBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = MyEffect() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/inkwebeffect.test.py b/share/extensions/test/inkwebeffect.test.py new file mode 100755 index 000000000..6fd59a008 --- /dev/null +++ b/share/extensions/test/inkwebeffect.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../inkwebeffect.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from inkwebeffect import * + +class InkWebEffectBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = InkWebEffect() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/interp-att-g.test.py b/share/extensions/test/interp-att-g.test.py new file mode 100755 index 000000000..f35a7a167 --- /dev/null +++ b/share/extensions/test/interp-att-g.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../interp-att-g.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from interp-att-g import * + +class InterpAttGBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = InterpAttG() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/interp.test.py b/share/extensions/test/interp.test.py new file mode 100755 index 000000000..85849fe69 --- /dev/null +++ b/share/extensions/test/interp.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../interp.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from interp import * + +class InterpBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Interp() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/lindenmayer.test.py b/share/extensions/test/lindenmayer.test.py new file mode 100755 index 000000000..21f42b4b7 --- /dev/null +++ b/share/extensions/test/lindenmayer.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../lindenmayer.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from lindenmayer import * + +class LSystemBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = LSystem() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/lorem_ipsum.test.py b/share/extensions/test/lorem_ipsum.test.py new file mode 100755 index 000000000..19e3c7b47 --- /dev/null +++ b/share/extensions/test/lorem_ipsum.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../lorem_ipsum.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from lorem_ipsum import * + +class MyEffectBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = MyEffect() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/markers_strokepaint.test.py b/share/extensions/test/markers_strokepaint.test.py new file mode 100755 index 000000000..8c1262b75 --- /dev/null +++ b/share/extensions/test/markers_strokepaint.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../markers_strokepaint.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from markers_strokepaint import * + +class MyEffectBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = MyEffect() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/measure.test.py b/share/extensions/test/measure.test.py new file mode 100755 index 000000000..f92b625ae --- /dev/null +++ b/share/extensions/test/measure.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../measure.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from measure import * + +class LengthBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Length() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/motion.test.py b/share/extensions/test/motion.test.py new file mode 100755 index 000000000..dda474804 --- /dev/null +++ b/share/extensions/test/motion.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../motion.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from motion import * + +class MotionBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Motion() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/pathmodifier.test.py b/share/extensions/test/pathmodifier.test.py new file mode 100755 index 000000000..2a3ba2f66 --- /dev/null +++ b/share/extensions/test/pathmodifier.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../pathmodifier.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from pathmodifier import * + +class PathModifierBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = PathModifier() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/perfectboundcover.test.py b/share/extensions/test/perfectboundcover.test.py new file mode 100755 index 000000000..26ca0ad00 --- /dev/null +++ b/share/extensions/test/perfectboundcover.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../perfectboundcover.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from perfectboundcover import * + +class PerfectBoundCoverBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = PerfectBoundCover() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/perspective.test.py b/share/extensions/test/perspective.test.py new file mode 100755 index 000000000..3d4daf540 --- /dev/null +++ b/share/extensions/test/perspective.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../perspective.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from perspective import * + +class ProjectBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Project() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/polyhedron_3d.test.py b/share/extensions/test/polyhedron_3d.test.py new file mode 100755 index 000000000..c150a5323 --- /dev/null +++ b/share/extensions/test/polyhedron_3d.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../polyhedron_3d.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from polyhedron_3d import * + +class Poly_3DBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Poly_3D() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/printing-marks.test.py b/share/extensions/test/printing-marks.test.py new file mode 100755 index 000000000..0438e327c --- /dev/null +++ b/share/extensions/test/printing-marks.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../printing-marks.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from printing-marks import * + +class Printing_MarksBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Printing_Marks() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/radiusrand.test.py b/share/extensions/test/radiusrand.test.py new file mode 100755 index 000000000..99cb2972b --- /dev/null +++ b/share/extensions/test/radiusrand.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../radiusrand.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from radiusrand import * + +class RadiusRandomizeBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = RadiusRandomize() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/render_alphabetsoup.test.py b/share/extensions/test/render_alphabetsoup.test.py new file mode 100755 index 000000000..b5575a052 --- /dev/null +++ b/share/extensions/test/render_alphabetsoup.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../render_alphabetsoup.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from render_alphabetsoup import * + +class AlphabetSoupBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = AlphabetSoup() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/render_barcode.test.py b/share/extensions/test/render_barcode.test.py new file mode 100755 index 000000000..0762ccb99 --- /dev/null +++ b/share/extensions/test/render_barcode.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../render_barcode.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from render_barcode import * + +class InsertBarcodeBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = InsertBarcode() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/restack.test.py b/share/extensions/test/restack.test.py new file mode 100755 index 000000000..da0001b2a --- /dev/null +++ b/share/extensions/test/restack.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../restack.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from restack import * + +class RestackBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Restack() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/rtree.test.py b/share/extensions/test/rtree.test.py new file mode 100755 index 000000000..56bf89c03 --- /dev/null +++ b/share/extensions/test/rtree.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../rtree.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from rtree import * + +class RTreeTurtleBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = RTreeTurtle() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/run-all-extension-tests b/share/extensions/test/run-all-extension-tests index 00b127342..c9dbfd498 100755 --- a/share/extensions/test/run-all-extension-tests +++ b/share/extensions/test/run-all-extension-tests @@ -6,6 +6,7 @@ cd "$(dirname "$0")" has_py_coverage=false py_cover_files=$( mktemp ) +failed_tests=$( mktemp ) if coverage.py -e >/dev/null 2>/dev/null; then has_py_coverage=true @@ -24,21 +25,39 @@ fi function run_py_test() { echo -e "\n>> Testing $1" if $has_py_coverage; then - $cover_py_cmd -x "$1.test.py" + if ! $cover_py_cmd -x "$1.test.py"; then + echo "$1" >> $failed_tests + fi echo "../$1.py" >> $py_cover_files else - python "$1.test.py" + if ! python "$1.test.py"; then + echo "$1" >> $failed_tests + fi fi + return 0 } -ls -1 *.test.py | -while read testFile; do - run_py_test $( echo $testFile | sed -r 's/^([^.]+)..*$/\1/' ) +tot_FAILED=0 + +for testFile in *.test.py; do + if ! run_py_test $( echo $testFile | sed -r 's/^([^.]+)..*$/\1/' ); then + let tot_FAILED++ + fi done -echo "" if $has_py_coverage; then + echo -e "\n>> Coverage Report:" cat $py_cover_files | xargs $cover_py_cmd -r fi -rm $py_cover_files +fail=false +if ! test -z "$( cat $failed_tests )"; then + echo -e "\nFailed extension tests:" + cat $failed_tests | sed 's/^/ - /' + fail=true +fi +echo "" + +rm $py_cover_files $failed_tests + +$fail && exit 1 \ No newline at end of file diff --git a/share/extensions/test/spirograph.test.py b/share/extensions/test/spirograph.test.py new file mode 100755 index 000000000..c7eefa61e --- /dev/null +++ b/share/extensions/test/spirograph.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../spirograph.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from spirograph import * + +class SpirographBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Spirograph() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/straightseg.test.py b/share/extensions/test/straightseg.test.py new file mode 100755 index 000000000..0a4d07b52 --- /dev/null +++ b/share/extensions/test/straightseg.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../straightseg.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from straightseg import * + +class SegmentStraightenerBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = SegmentStraightener() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/summersnight.test.py b/share/extensions/test/summersnight.test.py new file mode 100755 index 000000000..e8e2733b8 --- /dev/null +++ b/share/extensions/test/summersnight.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../summersnight.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from summersnight import * + +class ProjectBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Project() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/svg_and_media_zip_output.test.py b/share/extensions/test/svg_and_media_zip_output.test.py new file mode 100755 index 000000000..4e077edd3 --- /dev/null +++ b/share/extensions/test/svg_and_media_zip_output.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../svg_and_media_zip_output.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from svg_and_media_zip_output import * + +class MyEffectBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = MyEffect() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/triangle.test.py b/share/extensions/test/triangle.test.py new file mode 100755 index 000000000..96743f7e2 --- /dev/null +++ b/share/extensions/test/triangle.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../triangle.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from triangle import * + +class Grid_PolarBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Grid_Polar() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main() diff --git a/share/extensions/test/whirl.test.py b/share/extensions/test/whirl.test.py new file mode 100755 index 000000000..c08ea01c3 --- /dev/null +++ b/share/extensions/test/whirl.test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# This is only the automatic generated test file for ../whirl.py +# This must be filled with real tests and this commentary +# must be cleared. +# If you want to help, read the python unittest documentation: +# http://docs.python.org/library/unittest.html + +import sys +sys.path.append('..') # this line allows to import the extension code + +import unittest +from whirl import * + +class WhirlBasicTest(unittest.TestCase): + + #def setUp(self): + + def test_run_without_parameters(self): + args = [ 'minimal-blank.svg' ] + e = Whirl() + e.affect( args, False ) + #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) + +if __name__ == '__main__': + unittest.main()