Skip to content

Commit

Permalink
Added 4 unit tests of the PlotSize scale transform
Browse files Browse the repository at this point in the history
  • Loading branch information
jlstevens committed Mar 29, 2017
1 parent 8784e6e commit 32a1e6d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/teststreams.py
Expand Up @@ -177,3 +177,25 @@ def test_clashing_rename_method(self):
with self.assertRaises(KeyError) as cm:
renamed = xy.rename(x='xtest', y='x')
self.assertEqual(str(cm).endswith('parameter of the same name'), True)


class TestPlotSizeTransform(ComparisonTestCase):

def test_plotsize_initial_contents_1(self):
plotsize = PlotSize(width=300, height=400, scale=0.5)
self.assertEqual(plotsize.contents, {'width':300, 'height':400, 'scale':0.5})

def test_plotsize_update_1(self):
plotsize = PlotSize(scale=0.5)
plotsize.update(width=300, height=400)
self.assertEqual(plotsize.contents, {'width':150, 'height':200, 'scale':0.5})

def test_plotsize_initial_contents_2(self):
plotsize = PlotSize(width=600, height=100, scale=2)
self.assertEqual(plotsize.contents, {'width':600, 'height':100, 'scale':2})

def test_plotsize_update_2(self):
plotsize = PlotSize(scale=2)
plotsize.update(width=600, height=100)
self.assertEqual(plotsize.contents, {'width':1200, 'height':200, 'scale':2})

0 comments on commit 32a1e6d

Please sign in to comment.