2
Tests that various plot and data objects can be instantiated, assigned, and
3
re-assigned in any order.
8
from numpy import array
9
from enthought.chaco2.api import ArrayDataSource, DataRange1D, \
12
class DataPipelineTestCase(unittest.TestCase):
13
def test_piecewise_construction(self):
14
ary = array([1,2,3,4,5,6,7])
15
ds = ArrayDataSource()
19
self.assert_(r.low_setting == "auto")
20
self.assert_(r.high_setting == "auto")
21
self.assert_(r.low == 1)
22
self.assert_(r.high == 7)
24
mapper = LinearMapper()
28
screen_pts = mapper.map_screen(array([1,3,7]))
29
self.assert_(tuple(screen_pts) == (1.0, 3.0, 7.0))
32
def test_reverse_construction(self):
33
mapper = LinearMapper()
35
ds = ArrayDataSource()
36
ary = array([1,2,3,4,5,6,7])
44
self.assert_(r.low == 1)
45
self.assert_(r.high == 7)
46
screen_pts = mapper.map_screen(array([1,3,7]))
47
self.assert_(tuple(screen_pts) == (1.0, 3.0, 7.0))
51
if __name__ == '__main__':