Changeset 109 for trunk/tests/chart.py

Show
Ignore:
Timestamp:
10/27/08 16:49:58 (4 years ago)
Author:
lgs
Message:

Some refactoring and support for negative values in line and bar charts. Inspired by Nicolas patch

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/chart.py

    r85 r109  
    4545        self.assertEqual(area.w, 100) 
    4646        self.assertEqual(area.h, 300) 
     47        self.assertEqual(area.origin, 0.0) 
     48        msg = "<pycha.chart.Area@(10.00, 20.00) 100.00 x 300.00 Origin: 0.00>" 
     49        self.assertEqual(str(area), msg) 
    4750 
    4851class OptionTests(unittest.TestCase): 
     
    164167        self.assertEqual(ch.yscale, 1/4.0) 
    165168         
    166         # TODO: test with different options (xOriginIsZero, axis.range, ...) 
     169        # TODO: test with different options (axis.range, ...) 
    167170 
    168171    def test_updateTicks(self): 
     
    177180        ch._updateXY() 
    178181        ch._updateTicks() 
    179         xticks = [(0.0, 1), (1/3.0, 2), (2/3.0, 3)] 
     182        xticks = [(0.0, 0), (1/3.0, 1), (2/3.0, 2)] 
    180183        for i in range(len(xticks)): 
    181184            self.assertAlmostEqual(ch.xticks[i][0], xticks[i][0], 4) 
     
    189192            self.assertAlmostEqual(ch.yticks[i][1], yticks[i][1], 4) 
    190193 
    191     def test_updateExplicitTicks(self): 
     194    def _test_updateExplicitTicks(self): 
    192195        """Test for bug #7""" 
    193196        surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 500, 500)