/[thuban]/branches/WIP-pyshapelib-bramz/test/test_export.py
ViewVC logotype

Annotation of /branches/WIP-pyshapelib-bramz/test/test_export.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1454 - (hide annotations)
Fri Jul 18 14:41:04 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/test/test_export.py
File MIME type: text/x-python
File size: 1889 byte(s)
* test/test_export.py Remove unused imports. The OutputTransform
function is now in viewport.py and is called output_transform
(TestScalebar.test_output_transform)
(TestScalebar.test_OutputTransform): Renamed to
test_output_transform and updated to use output_transform instead
of OutputTransform

* Thuban/UI/view.py (OutputTransform): Moved to viewport.py and
renamed.
(MapCanvas.Export, MapPrintout.draw_on_dc): OutputTransform was
renamed to output_transform

* Thuban/UI/viewport.py (OutputTransform, output_transform):
Rename to output_transform

1 bh 1454 # Copyright (c) 2002, 2003 by Intevation GmbH
2 frank 915 # Authors:
3     # Frank Koormann <[email protected]>
4     #
5     # This program is free software under the GPL (>=v2)
6     # Read the file COPYING coming with Thuban for details.
7    
8     """
9     Test the Thuban export calculations
10     """
11    
12     __version__ = "$Revision$"
13     # $Source$
14     # $Id$
15    
16     import unittest
17    
18     import support
19     support.initthuban()
20    
21 bh 1454 from Thuban.UI.viewport import output_transform
22 frank 915
23     class TestScalebar(unittest.TestCase, support.FloatComparisonMixin):
24    
25     """Test cases for the Thuban export calculations
26     """
27    
28 bh 1454 def test_output_transform(self):
29     """Test output_transform()."""
30    
31     scale, offset, mapregion = output_transform(1.0, (0,0),
32     (200, 100), (200, 100))
33 frank 915 self.assertFloatEqual(0.3, scale)
34     self.assertFloatSeqEqual((0.0, 0.0), offset)
35     self.assertFloatSeqEqual((20.0, 20.0, 80.0, 80.0), mapregion)
36    
37 bh 1454 scale, offset, mapregion = output_transform(1.0, (0,0),
38     (200, 100), (100, 200))
39 frank 915 self.assertFloatEqual(0.16, scale)
40     self.assertFloatSeqEqual((0.0, 0.0), offset)
41     self.assertFloatSeqEqual((20.0, 20.0, 52.0, 52.0), mapregion)
42    
43 bh 1454 scale, offset, mapregion = output_transform(1.0, (5,5),
44     (200, 100), (100, 100))
45 frank 915 self.assertFloatEqual(0.16, scale)
46     self.assertFloatSeqEqual((0.8, 0.8), offset)
47     self.assertFloatSeqEqual((20.0, 20.0, 52.0, 52.0), mapregion)
48    
49 bh 1454 scale, offset, mapregion = output_transform(1.0, (0,0),
50     (200, 100), (200, 200))
51 frank 915 self.assertFloatEqual(0.52, scale)
52     self.assertFloatSeqEqual((0.0, 0.0), offset)
53     self.assertFloatSeqEqual((20, 20, 124.0, 124.0), mapregion)
54    
55    
56     if __name__ == "__main__":
57     unittest.main()

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26