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

Log of /branches/WIP-pyshapelib-bramz/test/test_layer.py

Parent Directory Parent Directory | Revision Log Revision Log


Sticky Revision:
(Current path doesn't exist after revision 2835)

Revision 2734 - (view) (annotate) - [select for diffs]
Modified Thu Mar 1 12:42:59 2007 UTC (18 years ago) by bramz
File length: 22831 byte(s)
Diff to previous 2688 , to selected 2339
made a copy

Revision 2688 - (view) (annotate) - [select for diffs]
Modified Fri Jun 30 12:27:20 2006 UTC (18 years, 8 months ago) by frank
Original Path: trunk/thuban/test/test_layer.py
File length: 22831 byte(s)
Diff to previous 2644 , to selected 2339
New Classification "Pattern": Classify text attributes by regexp.

Revision 2644 - (view) (annotate) - [select for diffs]
Modified Tue Jul 5 16:30:51 2005 UTC (19 years, 8 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 21974 byte(s)
Diff to previous 2587 , to selected 2339
* Thuban/Model/layer.py (Layer.__mangle_bounding_box)
(Layer.ClipBoundingBox): Rename ClipBoundingBox to
__mangle_bounding_box.  See the comments in the code and RT #2845

* test/test_layer.py (TestLayer.test_arc_layer_with_projection):
Remove the explicit test of ClipBoundingBox.  The method isn't
public anymore and the direct call in the test wasn't necessary in
the first place.  If ClipBoundingBox (now __mangle_bounding_box)
isn't called, the return value of ShapesInRegion will be
different.


Revision 2587 - (view) (annotate) - [select for diffs]
Modified Wed Mar 23 15:30:27 2005 UTC (19 years, 11 months ago) by jonathan
Original Path: trunk/thuban/test/test_layer.py
File length: 21901 byte(s)
Diff to previous 2562 , to selected 2339
Add support for adjusting the opacity of a raster layer.


Revision 2562 - (view) (annotate) - [select for diffs]
Modified Wed Feb 16 21:14:47 2005 UTC (20 years ago) by jonathan
Original Path: trunk/thuban/test/test_layer.py
File length: 21742 byte(s)
Diff to previous 2552 , to selected 2339
Further wxPython 2.5 changes using patches from Daniel Calvelo Aros
so that that wxproj doesn't crash. Added GUI support for selecting
alpha channel (opacity can't be selected yet).


Revision 2552 - (view) (annotate) - [select for diffs]
Modified Fri Jan 28 15:54:00 2005 UTC (20 years, 1 month ago) by jonathan
Original Path: trunk/thuban/test/test_layer.py
File length: 20873 byte(s)
Diff to previous 2551 , to selected 2339
Make layer's use_mask flag default to true. Support a bit array describing
the mask to use. Improve error handling in ProjectRasterFile (also addresses
RT #2947).


Revision 2551 - (view) (annotate) - [select for diffs]
Modified Thu Jan 27 14:19:41 2005 UTC (20 years, 1 month ago) by jonathan
Original Path: trunk/thuban/test/test_layer.py
File length: 20864 byte(s)
Diff to previous 2351 , to selected 2339
Add a new dialog box for raster layers. The dialog box allows
the user to toggle a mask that is generated by ProjectRasterFile
and is used to only draw the real parts of the projected image.


Revision 2351 - (view) (annotate) - [select for diffs]
Modified Sat Sep 25 18:49:20 2004 UTC (20 years, 5 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 19244 byte(s)
Diff to previous 2339
(TestLayer.test_arc_layer_with_projection):
Remove a debug print and some tab characters.


Revision 2339 - (view) (annotate) - [selected]
Modified Fri Aug 20 16:59:21 2004 UTC (20 years, 6 months ago) by silke
Original Path: trunk/thuban/test/test_layer.py
File length: 19246 byte(s)
Diff to previous 2229
Fix bug in projection handling of layers


Revision 2229 - (view) (annotate) - [select for diffs]
Modified Thu Jun 3 15:18:07 2004 UTC (20 years, 9 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 18978 byte(s)
Diff to previous 1987 , to selected 2339
(TestLayerModification.setUp): Save the
filename as an instance variable so we can refer to it in tests
(TestLayerModification.test_tree_info): Uncomment this method
again and make it work.  This tests for the formatting issue
filed in RT#2239 on 2004-01-13


Revision 1987 - (view) (annotate) - [select for diffs]
Modified Fri Nov 28 11:37:35 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 19047 byte(s)
Diff to previous 1983 , to selected 2339
(TestLayer.test_arc_layer_with_projection):
Add the ellipsoid to the projection since some Proj versions
complain if it's missing.


Revision 1983 - (view) (annotate) - [select for diffs]
Modified Thu Nov 27 15:57:23 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 18998 byte(s)
Diff to previous 1768 , to selected 2339
* Thuban/Model/layer.py (Layer.LatLongBoundingBox)
(Layer.ShapesBoundingBox, RasterLayer.LatLongBoundingBox): Use the
new InverseBBox method to determine the unprojected bounding box
(Layer.ShapesInRegion): Use the ForwardBBox method to project the
bbox.

* test/test_layer.py (TestLayer.test_point_layer_with_projection):
Removed.
(TestLayer.test_arc_layer_with_projection): New. This test is
better able to test whether bounding boxes are projected correctly
than test_point_layer_with_projection


Revision 1768 - (view) (annotate) - [select for diffs]
Modified Thu Oct 2 15:15:04 2003 UTC (21 years, 5 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 18797 byte(s)
Diff to previous 1687 , to selected 2339
(TestLayer.test_empty_layer): Explicitly
close the dbf file we create so that it's contents have been
written properly.


Revision 1687 - (view) (annotate) - [select for diffs]
Modified Fri Aug 29 10:02:16 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 18777 byte(s)
Diff to previous 1681 , to selected 2339
Add some missing parameters to projections. Proj complains about
them on windows but for some reason not on Linux.

* test/test_save.py (SaveSessionTest.testLayerProjection): Add
missing required projection parameters

* test/test_proj.py (TestProjFile.test): Add missing required
projection parameters

* test/test_load_0_8.py (TestLayerProjection.file_contents)
(TestLayerProjection.test): Add missing required projection
parameters and tests for them

* test/test_load.py (TestLayerProjection.file_contents)
(TestLayerProjection.test): Add missing required projection
parameters and tests for them

* test/test_layer.py (TestLayer.test_base_layer): Add missing
required projection parameters


Revision 1681 - (view) (annotate) - [select for diffs]
Modified Thu Aug 28 14:37:36 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 18761 byte(s)
Diff to previous 1599 , to selected 2339
(TestLayer.tearDown): Call the session's
Destroy method


Revision 1599 - (view) (annotate) - [select for diffs]
Modified Mon Aug 18 12:45:28 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 18730 byte(s)
Diff to previous 1593 , to selected 2339
Fix some bugs in Thuban and the test suite that were uncovered by
changes introduced in Python 2.3:

* Thuban/Model/table.py (DBFTable.__init__): Make sure the
filename is an absolute name

* Thuban/Model/layer.py (RasterLayer.__init__): Make sure the
filename is an absolute name

* test/test_save.py (SaveSessionTest.testRasterLayer): Use a
unique filename to save to and use the correct relative filename
in the expected output.
(SaveSessionTest.test_dbf_table): Use the correct relative
filename in the expected output.

* test/test_layer.py (TestLayer.test_raster_layer): Update the
test to check whether the filename is absolute.


Revision 1593 - (view) (annotate) - [select for diffs]
Modified Fri Aug 15 14:10:27 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 18713 byte(s)
Diff to previous 1587 , to selected 2339
Change the way shapes are returned by a shape store. The
ShapesInRegion method returns an iterator over actual shape
objects instead of a list of shape ids.

* Thuban/Model/data.py (ShapefileShape.ShapeID): New. Return shape
id.
(ShapefileStore.ShapesInRegion): Return an iterator over the
shapes which yields shape objects instead of returning a list of
shape ids
(ShapefileStore.AllShapes): New. Return an iterator over all
shapes in the shape store
(DerivedShapeStore.AllShapes): New. Like in ShapefileStore

* Thuban/Model/layer.py (Layer.ShapesInRegion): Update
doc-string.

* Thuban/UI/baserenderer.py
(BaseRenderer.layer_ids, BaseRenderer.layer_shapes): Rename to
layer_shapes and make it return an iterator containg shapes
instead of a list of ids.
(BaseRenderer.draw_shape_layer): Update doc-string; Adapt to
layer_shapes() change

* Thuban/UI/renderer.py (ScreenRenderer.layer_ids)
(ScreenRenderer.layer_shapes): Rename as in BaseRenderer

* Thuban/UI/viewport.py (ViewPort._find_shape_in_layer): Adapt to
changes in the ShapesInRegion return value.
(ViewPort._get_hit_tester): Remove commented out code

* test/mockgeo.py (SimpleShapeStore.ShapesInRegion): Adapt to the
new return value.
(SimpleShapeStore.AllShapes): New. Implement this method too.

* test/test_layer.py (TestLayer.test_arc_layer)
(TestLayer.test_polygon_layer, TestLayer.test_point_layer)
(TestLayer.test_point_layer_with_projection)
(TestLayer.test_derived_store): Adapt to changes in the
ShapesInRegion return value.

* test/test_shapefilestore.py
(TestShapefileStoreArc.test_shapes_in_region)
(TestShapefileStorePolygon.test_shapes_in_region)
(TestShapefileStorePoint.test_shapes_in_region): Adapt to changes
in the ShapesInRegion return value.
(TestShapefileStorePoint.test_all_shapes)
(TestShapefileStoreArc.test_shape_shapeid): New tests for the new
methods

* test/test_derivedshapestore.py
(TestDerivedShapeStore.test_shapes_in_region): Adapt to changes in
the ShapesInRegion return value.
(TestDerivedShapeStore.test_all_shapes)
(TestDerivedShapeStore.test_shape_shapeid): New tests for the new
methods


Revision 1587 - (view) (annotate) - [select for diffs]
Modified Fri Aug 15 10:31:07 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 18526 byte(s)
Diff to previous 1576 , to selected 2339
* Thuban/Model/layer.py (Layer.ShapesInRegion): Apply the layer
projection to all corners of the bounding box to get a better
approximation of the projected bounding box

* test/test_layer.py (TestLayer.test_point_layer_with_projection):
New. Test coordinate handling of a layer with a projection.
Catches the bug fixed in Layer.ShapesInRegion


Revision 1576 - (view) (annotate) - [select for diffs]
Modified Mon Aug 11 12:08:26 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 17484 byte(s)
Diff to previous 1555 , to selected 2339
(TestLayer.assertPointListEquals): Removed.
It's now in FloatComparisonMixin


Revision 1555 - (view) (annotate) - [select for diffs]
Modified Thu Aug 7 15:41:05 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 17808 byte(s)
Diff to previous 1551 , to selected 2339
* test/support.py (SkipTest, ThubanTestResult, ThubanTestRunner)
(ThubanTestProgram): New classes that extend the respective
classes from unittest. These new version support skipping tests
under certain expected conditions. In the Thuban test suite we
uses this for tests that require the optional gdal support.
(run_tests): Use ThubanTestProgram instead of the unittest.main()

* test/runtests.py (main): Use the new ThubanTestRunner instead of
the normal one from unittest

* test/test_layer.py (TestLayer.test_raster_layer): If this test
is not run because gdal support isn't available report this to the
runner.

* test/test_baserenderer.py
(TestBaseRenderer.test_raster_no_projection): Do not run this test
if gdal support isn't available and report this to the runner.


Revision 1551 - (view) (annotate) - [select for diffs]
Modified Wed Aug 6 17:21:07 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 17773 byte(s)
Diff to previous 1538 , to selected 2339
* Thuban/Model/data.py (ShapefileStore.Shape): For consistency, a
Shape object will always have the coordinates as a list of list of
coordinate pairs (tuples).
(Shape.compute_bbox): Adapt to new representation.

* Thuban/UI/viewport.py (ViewPort.find_shape_at)
(ViewPort.LabelShapeAt): Adapt to new coordinate representation in
Shape objects.

* test/test_shapefilestore.py
(ShapefileStoreTests.assertFloatTuplesEqual)
(ShapefileStoreTests.assertPointListEquals): Rename to
assertPointListEquals and change purpose to checking equality of
the lists returned by Shape.Points().
(TestShapefileStoreArc.test_shape)
(TestShapefileStorePolygon.test_shape)
(TestShapefileStorePoint.test_shape): Use the new
assertPointListEquals instead of assertFloatTuplesEqual

* test/test_layer.py (TestLayer.assertFloatTuplesEqual)
(TestLayer.assertPointListEquals): Rename to assertPointListEquals
and change purpose to checking equality of the lists returned by
Shape.Points().
(TestLayer.test_arc_layer, TestLayer.test_arc_layer)
(TestLayer.test_polygon_layer, TestLayer.test_point_layer)
(TestLayer.test_derived_store): Use the new assertPointListEquals
instead of assertFloatTuplesEqual

* test/test_derivedshapestore.py
(TestDerivedShapeStore.assertFloatTuplesEqual)
(TestDerivedShapeStore.assertPointListEquals): Rename to
assertPointListEquals and change purpose to checking equality of
the lists returned by Shape.Points().
(TestDerivedShapeStore.test_shape): Use the new
assertPointListEquals instead of assertFloatTuplesEqual


Revision 1538 - (view) (annotate) - [select for diffs]
Modified Fri Aug 1 14:27:46 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 17673 byte(s)
Diff to previous 1452 , to selected 2339
Import the SHAPETYPE_* constants from data
instead of layer.
(TestLayer.test_derived_store): Remove the test for the exception
when instantiating the DerivedShapeStore with an incompatible
table which is now in test_derivedshapestore.py. Add some more
tests of the layer methods to determine whether they work for a
DerivedShapeStore as well.


Revision 1452 - (view) (annotate) - [select for diffs]
Modified Fri Jul 18 12:57:59 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 17107 byte(s)
Diff to previous 1438 , to selected 2339
* Thuban/Model/layer.py (Layer.__init__): Rename
classificationField to classificatin_column and init it here so
that it can be used in SetClassificationColumn
(Layer.GetClassificationColumn, Layer.GetClassificationField):
Rename to GetClassificationColumn.
(Layer.SetClassificationColumn, Layer.SetClassificationField):
Rename to SetClassificationColumn and issue a LAYER_CHANGED
message if the column changes.
(Layer._classification_changed, Layer.ClassChanged): Rename to
_classification_changed. Update the callers.
(Layer.SetShapeStore): Further field->column renames.

* Thuban/Model/load.py (SessionLoader.start_classification)
(SessionLoader.start_clpoint): Updates because of
field->column method name changes in the Layer class

* Thuban/Model/save.py (SessionSaver.write_classification): Updates
because of field->column method name changes in the Layer class

* Thuban/UI/classifier.py (Classifier.__init__)
(Classifier._OnTry, Classifier._OnRevert): Updates because of
field->column method name changes in the Layer class

* Thuban/UI/renderer.py (MapRenderer.draw_shape_layer): Updates
because of field->column method name changes in the Layer class

* Thuban/UI/viewport.py (ViewPort.find_shape_at): Updates because
of field->column method name changes in the Layer class

* test/test_save.py (SaveSessionTest.testClassifiedLayer)
(SaveSessionTest.testClassifiedLayer): Update because of
field->column method name changes in the Layer class

* test/test_layer.py (SetShapeStoreTests.setUp)
(SetShapeStoreTests.test_sanity): Update because of field->column
method name changes in the Layer class
(TestLayerModification.setUp): Subscribe to LAYER_CHANGED as well
(TestLayerModification.test_sanity)
(TestLayerModification.test_initial_settings): remove unsued code
and rename to test_sanity.
(TestLayerModification.test_set_classification): New test for
SetClassification and SetClassificationField.


Revision 1438 - (view) (annotate) - [select for diffs]
Modified Wed Jul 16 13:25:30 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/test/test_layer.py
File length: 16376 byte(s)
Diff to previous 1278 , to selected 2339
(SetShapeStoreTests.setUp): Classification
        __init__ no longer has a field parameter, use SetClassificationField.
(SetShapeStoreTests.test_sanity): Use layer object to get class field info.


Revision 1278 - (view) (annotate) - [select for diffs]
Modified Fri Jun 20 17:46:58 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/test/test_layer.py
File length: 16285 byte(s)
Diff to previous 1262 , to selected 2339
Add tests in each type of layer for HasClassification() and HasShapes()


Revision 1262 - (view) (annotate) - [select for diffs]
Modified Fri Jun 20 14:15:30 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/test/test_layer.py
File length: 15877 byte(s)
Diff to previous 1174 , to selected 2339
(TestLayer.test_derived_store): Add
        a test for the new exception in DerivedShapeStore.__init__.


Revision 1174 - (view) (annotate) - [select for diffs]
Modified Thu Jun 12 13:37:29 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/test/test_layer.py
File length: 15427 byte(s)
Diff to previous 1142 , to selected 2339
Check for existence of gdal.


Revision 1142 - (view) (annotate) - [select for diffs]
Modified Tue Jun 10 09:41:57 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 15320 byte(s)
Diff to previous 1088 , to selected 2339
* Thuban/Model/messages.py (LAYER_SHAPESTORE_REPLACED): New
message.

* Thuban/Model/layer.py (Layer.SetShapeStore): Send
LAYER_SHAPESTORE_REPLACED when the shapestore changes. A
LAYER_CHANGED will still be sent if the classification changes.

* Thuban/UI/classifier.py (Classifier.__init__): Add the map as
parameter so we can subscribe to some of its messages
(Classifier.__init__): Subscribe to the map's MAP_LAYERS_REMOVED
and the layer's LAYER_SHAPESTORE_REPLACED
(Classifier.unsubscribe_messages): New. Unsubscribe from message
subscribed to in __init__
(Classifier.map_layers_removed)
(Classifier.layer_shapestore_replaced): receivers for the messages
subscribed to in __init__. Unsubscribe and close the dialog

* Thuban/UI/mainwindow.py (MainWindow.OpenLayerProperties): Pass
the map to the Classifier dialog

* test/test_layer.py (SetShapeStoreTests): Derive from
SubscriberMixin as well so we can test messages
(SetShapeStoreTests.setUp): Subscribe to some of the layer's
messages
(SetShapeStoreTests.tearDown): Clear the messages again
(SetShapeStoreTests.test_sanity): Expand the doc-string and check
for the modified flag too
(SetShapeStoreTests.test_set_shape_store_modified_flag): New test
to check whether SetShapeStore sets the modified flag
(SetShapeStoreTests.test_set_shape_store_different_field_name)
(SetShapeStoreTests.test_set_shape_store_same_field)
(SetShapeStoreTests.test_set_shape_store_same_field_different_type):
Add tests for the messages. This checks both the new
LAYER_SHAPESTORE_REPLACED and the older LAYER_CHANGED


Revision 1088 - (view) (annotate) - [select for diffs]
Modified Wed May 28 12:42:23 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 14034 byte(s)
Diff to previous 996 , to selected 2339
* Thuban/Model/layer.py (Layer.SetShapeStore): Set the
classification to "None" if the type of the field has changed.

* test/test_layer.py (SetShapeStoreTests): New. Class with a few
test for the Layer.SetShapeStore method


Revision 996 - (view) (annotate) - [select for diffs]
Modified Thu May 22 18:21:10 2003 UTC (21 years, 9 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 11268 byte(s)
Diff to previous 947 , to selected 2339
* test/test_layer.py (TestLayer.setUp, TestLayer.tearDown):
Provide a better way to destroy the layers
(TestLayer.test_base_layer, TestLayer.test_arc_layer)
(TestLayer.test_point_layer, TestLayer.test_empty_layer)
(TestLayer.test_polygon_layer, TestLayer.test_get_field_type): Use
the new way to destroy the layers.
(TestLayer.test_derived_store): New. Test for using a layer with a
DerivedShapeStore

* Thuban/Model/layer.py (Layer.SetShapeStore): Only set the
filename if the shape store actually has one.


Revision 947 - (view) (annotate) - [select for diffs]
Modified Tue May 20 15:27:19 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/test/test_layer.py
File length: 10432 byte(s)
Diff to previous 839 , to selected 2339
Added tests associated with the raster layer code.


Revision 839 - (view) (annotate) - [select for diffs]
Modified Tue May 6 15:54:18 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 9134 byte(s)
Diff to previous 832 , to selected 2339
Convert all table users to use the new table interface. This only
covers Thuban itself, not GREAT-ER or other applications built on
Thuban yet, so the compatibility interface stays in place for the
time being but it now issues DeprecationWarnings.

Finally, the new Table interface has a new method, HasColumn.

* Thuban/Model/table.py (OldTableInterfaceMixin): All methods
issue deprecation warnings when they're. The warnings refer to the
caller of the method.
(OldTableInterfaceMixin.__deprecation_warning): New. Helper method
for the deprecation warnings

* test/test_table.py: Ignore the deprecation warnings for the old
table in the tests in this module. The purpose of the tests is to
test the old interface, after all.

* test/test_transientdb.py
(TestTransientTable.run_iceland_political_tests): Use the
constants for the types. Add a test for HasColumn
(TestTransientTable.test_transient_joined_table): Adapt to new
table interface. Add a test for HasColumn
(TestTransientTable.test_transient_table_read_twice): Adapt to new
table interface

* Thuban/Model/transientdb.py (TransientTableBase.HasColumn)
(AutoTransientTable.HasColumn): Implement the new table interface
method
(AutoTransientTable.ReadRowAsDict, AutoTransientTable.ValueRange)
(AutoTransientTable.UniqueValues): Adapt to new table interface

* Thuban/Model/layer.py (Layer.SetShapeStore, Layer.GetFieldType):
Adapt to new table interface

* test/test_layer.py (TestLayer.open_shapefile): Helper method to
simplify opening shapefiles a bit easier.
(TestLayer.test_arc_layer, TestLayer.test_polygon_layer)
(TestLayer.test_point_layer): Use the new helper method
(TestLayer.test_get_field_type): New. Test for the GetFieldType
method

* test/test_dbf_table.py (TestDBFTable.test_has_column): Test for
the new table method

* test/test_memory_table.py (TestMemoryTable.test_has_column):
Test for the new table method HasColumn


Revision 832 - (view) (annotate) - [select for diffs]
Modified Tue May 6 12:07:36 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/test/test_layer.py
File length: 8734 byte(s)
Diff to previous 723 , to selected 2339
(TestLayer.test_arc_layer): Add some tests for Layer.ShapesBoundingBox().


Revision 723 - (view) (annotate) - [select for diffs]
Modified Thu Apr 24 15:31:53 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 7779 byte(s)
Diff to previous 599 , to selected 2339
First step towards table management. Introduce a simple data
abstraction so that we replace the data a layer uses more easily
in the next step.

* Thuban/Model/data.py: New file with a simple data abstraction
that bundles shapefile and dbffile into one object.

* Thuban/Model/session.py (Session.OpenShapefile): New method to
open shapefiles and return a shape store object

* Thuban/Model/layer.py (Layer.__init__): Pass the data as a store
object instead of a shapefile filename. This introduces a new
instance variable store holding the datastore. For intermediate
backwards compatibility keep the old instance variables.
(open_shapefile): Removed. No longer needed with the shape store.
(Layer.SetShapeStore, Layer.ShapeStore): New methods to set and
get the shape store used by a layer.
(Layer.Destroy): No need to explicitly destroy the shapefile or
table anymore.

* Thuban/UI/mainwindow.py (MainWindow.AddLayer)
(MainWindow.AddLayer): Use the session's OpenShapefile method to
open shapefiles

* Thuban/Model/load.py (ProcessSession.start_layer): Use the
session's OpenShapefile method to open shapefiles

* test/test_classification.py
(TestClassification.test_classification): Use the session's
OpenShapefile method to open shapefiles and build the filename in
a more platform independed way

* test/test_layer.py (TestLayer.setUp, TestLayer.tearDown):
Implement to have a session to use in the tests
(TestLayer.test_arc_layer, TestLayer.test_polygon_layer)
(TestLayer.test_point_layer, TestLayer.test_empty_layer): Use the
session's OpenShapefile method to open shapefiles
(TestLayerLegend.setUp): Instantiate a session so that we can use
it to open shapefiles.
(TestLayerLegend.tearDown): Make sure that all references to
layers and session are removed otherwise we may get a resource
leak

* test/test_map.py (TestMapAddLayer.test_add_layer)
(TestMapWithContents.setUp): Instantiate a session so that we can
use it to open shapefiles.
(TestMapWithContents.tearDown): Make sure that all references to
layers, maps and sessions are removed otherwise we may get a
resource leak
("__main__"): use support.run_tests() so that more info about
uncollected garbage is printed

* test/test_save.py (SaveSessionTest.testSingleLayer): Use the
session's OpenShapefile method to open shapefiles
("__main__"): use support.run_tests() so that more info about
uncollected garbage is printed

* test/test_selection.py (TestSelection.tearDown): Make sure that
all references to the session and the selection are removed
otherwise we may get a resource leak
(TestSelection.get_layer): Instantiate a session so that we can
use it to open shapefiles.
("__main__"): use support.run_tests() so that more info about
uncollected garbage is printed

* test/test_session.py (TestSessionBase.tearDown)
(TestSessionWithContent.tearDown): Make sure that all references
to the session and layers are removed otherwise we may get a
resource leak
(TestSessionWithContent.setUp): Use the session's OpenShapefile
method to open shapefiles


Revision 599 - (view) (annotate) - [select for diffs]
Modified Thu Apr 3 11:37:13 2003 UTC (21 years, 11 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 7194 byte(s)
Diff to previous 409 , to selected 2339
Use support.run_tests instead of
unittest.main so we get memory leak information
(TestLayer.test_arc_layer, TestLayer.test_polygon_layer)
(TestLayer.test_point_layer, TestLayer.test_empty_layer)
(TestLayerLegend.test_visibility): Call the layer's Destroy method
to fix a memory leak.


Revision 409 - (view) (annotate) - [select for diffs]
Modified Wed Feb 19 16:50:39 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/test/test_layer.py
File length: 7088 byte(s)
Diff to previous 395 , to selected 2339
Updated the tests to use the new functions that are in the respective classes.


Revision 395 - (view) (annotate) - [select for diffs]
Modified Mon Feb 10 15:28:02 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/test/test_layer.py
File length: 7085 byte(s)
Diff to previous 336 , to selected 2339
fix tests to work with new code changes.


Revision 336 - (view) (annotate) - [select for diffs]
Modified Fri Sep 20 16:26:09 2002 UTC (22 years, 5 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 7929 byte(s)
Diff to previous 331 , to selected 2339
(TestLayer.test_empty_layer): Create an empty
DBFfile too because Thuban layers can't yet cope missing DBF
files.


Revision 331 - (view) (annotate) - [select for diffs]
Added Fri Sep 20 14:34:23 2002 UTC (22 years, 5 months ago) by bh
Original Path: trunk/thuban/test/test_layer.py
File length: 7627 byte(s)
Diff to selected 2339
New. Test cases for Thuban.Model.layer


This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26