-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace dangerous [] defaults with None, and explicitly check for None (
#467) * add failing tests * use None as default instead of [] * remove some commented out code * some style fixes
- Loading branch information
1 parent
130fb11
commit 550561d
Showing
3 changed files
with
46 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import unittest | ||
|
||
from enable.savage.svg.backends.kiva.renderer import ( | ||
LinearGradientBrush, | ||
RadialGradientBrush, | ||
Renderer, | ||
) | ||
|
||
|
||
class TestRenderer(unittest.TestCase): | ||
|
||
def test_linear_gradient_brush(self): | ||
lgb = LinearGradientBrush(1,1,2,2,3) | ||
lgb.transforms.append('a') | ||
self.assertEqual(LinearGradientBrush(1,1,2,2,3).transforms, []) | ||
|
||
def test_radial_gradient_brush(self): | ||
rgb = RadialGradientBrush(1,1,2,2,3) | ||
rgb.transforms.append('a') | ||
self.assertEqual(RadialGradientBrush(1,1,2,2,3).transforms, []) | ||
|
||
def test_create_linear_gradient_brush(self): | ||
renderer = Renderer() | ||
lgb = renderer.createLinearGradientBrush(1,1,2,2,3) | ||
lgb.transforms.append('a') | ||
self.assertEqual( | ||
renderer.createLinearGradientBrush(1,1,2,2,3).transforms, | ||
[] | ||
) | ||
|
||
def test_create_radial_gradient_brush(self): | ||
renderer = Renderer() | ||
rgb = renderer.createRadialGradientBrush(1,1,2,2,3) | ||
rgb.transforms.append('a') | ||
self.assertEqual( | ||
renderer.createRadialGradientBrush(1,1,2,2,3).transforms, | ||
[] | ||
) |