class TestMkHex(TestCase): def setUp(self): self.gi = TargetSvg() def testZero(self): self.assertEqual(self.gi.mkHex(0.0), "00") def testFull(self): self.assertEqual(self.gi.mkHex(1.0), "ff") def testOne(self): self.assertEqual(self.gi.mkHex(1.0 / 255), "01") def testFifteen(self): self.assertEqual(self.gi.mkHex(15.0 / 255), "0f") def test254(self): self.assertEqual(self.gi.mkHex(254.0 / 255), "fe")
class TestMkHex(TestCase): def setUp(self): self.gi =TargetSvg() def testZero(self): self.assertEqual(self.gi.mkHex(0.0),"00") def testFull(self): self.assertEqual(self.gi.mkHex(1.0) , "ff") def testOne(self): self.assertEqual(self.gi.mkHex(1.0/255) , "01") def testFifteen(self): self.assertEqual(self.gi.mkHex(15.0/255) , "0f") def test254(self): self.assertEqual(self.gi.mkHex(254.0/255) , "fe")
class TestTargetSvg(TestCase): def setUp(self): self.ts = TargetSvg() def tearDown(self): del self.ts def testReset(self): self.ts.reset() self.assertFalse(self.ts.style is None) self.assertFalse(self.ts.svg_def is None) self.assertFalse(self.ts.svg_dom is None) self.assertFalse(self.ts.svg_current_layer is None) self.assertFalse(self.ts.required_defs is None) def testArrowHeadColor(self): self.ts.setGraffleStyle({ 'stroke': { 'Color': { 'r': 0.5, 'g': 0.5, 'b': 0.5 }, 'HeadArrow': "FilledArrow" } }) self.assertEqual(self.ts.style['marker-end'], 'url(#Arrow1Lend_808080_1.000000px)') self.assertTrue( 'Arrow1Lend_808080_1.000000px' in self.ts.required_defs) def testArrowTailColor(self): self.ts.setGraffleStyle({ 'stroke': { 'Color': { 'r': 0.5, 'g': 0.5, 'b': 0.5 }, 'TailArrow': "FilledArrow" } }) self.assertEqual(self.ts.style['marker-start'], 'url(#Arrow1Lstart_808080_1.000000px)') self.assertTrue( 'Arrow1Lstart_808080_1.000000px' in self.ts.required_defs)
class TestTargetSvg(TestCase): def setUp(self): self.ts = TargetSvg() def tearDown(self): del self.ts def testReset(self): self.ts.reset() self.assertFalse(self.ts.style is None) self.assertFalse(self.ts.svg_def is None) self.assertFalse(self.ts.svg_dom is None) self.assertFalse(self.ts.svg_current_layer is None) self.assertFalse(self.ts.required_defs is None) def testArrowHeadColor(self): self.ts.setGraffleStyle({'stroke':{'Color':{'r':0.5,'g':0.5,'b':0.5},'HeadArrow':"FilledArrow"}}) self.assertEqual(self.ts.style['marker-end'],'url(#Arrow1Lend_808080_1.000000px)') self.assertTrue('Arrow1Lend_808080_1.000000px' in self.ts.required_defs) def testArrowTailColor(self): self.ts.setGraffleStyle({'stroke':{'Color':{'r':0.5,'g':0.5,'b':0.5},'TailArrow':"FilledArrow"}}) self.assertEqual(self.ts.style['marker-start'],'url(#Arrow1Lstart_808080_1.000000px)') self.assertTrue('Arrow1Lstart_808080_1.000000px' in self.ts.required_defs)
def setUp(self): self.gi =TargetSvg()
def setUp(self): self.ts = TargetSvg()
def setUp(self): self.gi = TargetSvg()