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

Contents of /branches/WIP-pyshapelib-bramz/test/runtests.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1219 - (show annotations)
Mon Jun 16 17:42:54 2003 UTC (21 years, 8 months ago) by bh
Original Path: trunk/thuban/test/runtests.py
File MIME type: text/x-python
File size: 1952 byte(s)
Update to the layer interface: Direct access to the table,
shapetable, shapefile and filename attributes is now actively
deprecated by issuing deprecation warnings for all places where
this happens.

* Thuban/Model/layer.py (Layer.__getattr__): New. Implement access
to the instance variables table, shapetable, shapefile and
filename via __getattr__ so that we can issue a deprecation
warning.
(Layer.SetShapeStore): Don't set the deprecated instance variables
any more
(Layer.SetShapeStore): Don't use deprecated layer instance
variables
(Layer.Destroy): No need to explicitly remove the instance
variables any more
(Layer.GetFieldType, Layer.Shape): Don't use deprecated layer
instance variables

* Thuban/UI/classgen.py (ClassGenDialog.__init__)
(GenUniformPanel._OnRetrieve, GenUniquePanel._OnRetrieve)
(GenQuantilesPanel.GetList, GenQuantilesPanel.OnRetrieve): Don't
use deprecated layer instance variables

* Thuban/UI/classifier.py (Classifier.__init__): Don't use
deprecated layer instance variables

* Thuban/UI/identifyview.py (IdentifyListCtrl.selected_shape)
(IdentifyGridCtrl.selected_shape): Don't set the deprecated layer
instance variables

* Thuban/UI/tableview.py (LayerTableGrid.select_shapes): Don't use
deprecated layer instance variables

* Thuban/UI/mainwindow.py (MainWindow.LayerShowTable): Don't use
deprecated layer instance variables

* Thuban/Model/save.py (SessionSaver.write_layer): Don't use
deprecated layer instance variables

* Thuban/UI/renderer.py (MapRenderer.draw_shape_layer)
(MapRenderer.polygon_render_param): Don't use deprecated layer instance
variables

* test/runtests.py (main): Turn Thuban's deprecation warnings into
errors so that they're cought by the tests

* test/test_load.py (TestSingleLayer.test): Don't use deprecated
layer instance variables

1 # Copyright (c) 2002, 2003 by Intevation GmbH
2 # Authors:
3 # Bernhard Herzog <[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 Main entry point for the Thuban test suite.
10
11 Just run this file as a python script to execute all tests
12 """
13
14
15 import os, sys
16 import warnings
17 import unittest
18
19 import support
20 support.initthuban()
21 import Thuban.Lib.connector
22
23 def main():
24 """Run all the tests in the Thuban test suite"""
25
26 # Turn Thuban's deprecation warnings into errors so they're cought
27 # by the tests
28 #
29 # Maintenance: Keep a warning filter until the backwards
30 # compatibility code is removed at which time using the old
31 # interfaces should lead to other errors anyway.
32
33 # The layer attributes table, shapetable, shapefile and filename are
34 # deprecated.
35 warnings.filterwarnings("error", "The Layer attribute.*is deprecated",
36 DeprecationWarning)
37
38 # Usage of the old table interface. This old interface is still used
39 # by the test_table.py module which calls filterwarnings too to
40 # ignore the warnings issued by its own intended use of the old
41 # interface.
42 warnings.filterwarnings("error", ".*old table interface.*",
43 DeprecationWarning)
44
45
46 # All Python files starting with test in the current directory
47 # contain test cases.
48 # FIXME: It should be possible to run runtests.py even when not in
49 # the test directory
50 files = os.listdir(os.curdir)
51 names = []
52 for file in files:
53 if file[:4] == "test" and file[-3:] == ".py":
54 names.append(file[:-3])
55
56 suite = unittest.defaultTestLoader.loadTestsFromNames(names)
57 runner = unittest.TextTestRunner(verbosity = 2)
58 result = runner.run(suite)
59
60 support.print_garbage_information()
61
62 sys.exit(not result.wasSuccessful())
63
64
65 if __name__ == "__main__":
66 main()

Properties

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26