Commit f51b21e8 authored by Aurélio A. Heckert's avatar Aurélio A. Heckert Committed by aurium

more basic test files and basic effect corrections

(bzr r7706)
parent 1b6b60c2
......@@ -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()
......@@ -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()
......@@ -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()
......
......@@ -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 ##
......@@ -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()
......@@ -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()
#!/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()
#!/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()
#!/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()
......@@ -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"
......
#!/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()
#!/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()
#!/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()
#!/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()
#!/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()
#!/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()
#!/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()
#!/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()
#!/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()
#!/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()
#!/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()
#!/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()
#!/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()
#!/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()
#!/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()
#!/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()
#!/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()
#!/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()
#!/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' ]