~ubuntu-branches/ubuntu/vivid/python-chaco/vivid-proposed

« back to all changes in this revision

Viewing changes to enthought/chaco2/tests/data_view_test_case.py

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2010-02-28 14:05:25 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100228140525-1eo43ddoakb2j3j9
Tags: 3.3.0-1
* New upstream release
* Switch to source format 3.0 (quilt)
* Bump Standards-Version to 3.8.4
* Remove transition package: python-enthought-chaco2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
import unittest
3
 
 
4
 
from enthought.chaco2.api import DataRange2D, DataView, GridDataSource 
5
 
 
6
 
 
7
 
class DataViewTestCase(unittest.TestCase):
8
 
    
9
 
    def test_empty(self):
10
 
        dv = DataView()
11
 
        self.assert_(dv.orientation=="h")
12
 
        self.assert_(dv.index_scale=="linear")
13
 
        self.assert_(dv.bgcolor=="white")
14
 
        self.assert_(dv.overlay_border==True)
15
 
 
16
 
        self.assert_(dv.range2d.x_range==dv.index_range)
17
 
        self.assert_(dv.range2d.y_range==dv.value_range)
18
 
 
19
 
    def test_orientation(self):
20
 
        dv = DataView()
21
 
        x_mapper_start = dv.x_mapper
22
 
        y_mapper_start = dv.y_mapper
23
 
        dv.orientation = "v"
24
 
        self.assert_(dv.x_mapper is y_mapper_start)
25
 
        self.assert_(dv.y_mapper is x_mapper_start)
26
 
 
27
 
    def test_range2d_changed(self):
28
 
        dv = DataView()
29
 
        ds = GridDataSource()
30
 
        dv.range2d.add(ds)
31
 
        old_range = dv.range2d
32
 
        r = DataRange2D()
33
 
 
34
 
        self.assert_(dv.range2d.sources==[ds])
35
 
        dv.range2d = r
36
 
        self.assert_(dv.range2d.sources==[ds])
37
 
        self.assert_(old_range.sources==[])
38
 
        self.assert_(dv.range2d.x_range is dv.index_mapper.range)
39
 
        self.assert_(dv.range2d.y_range is dv.value_mapper.range)
40
 
 
41
 
if __name__ == '__main__':
42
 
    import nose
43
 
    nose.run()