Log of /branches/WIP-pyshapelib-bramz/test/test_layer.py
Parent Directory
|
Revision Log
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 336
* 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
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 336
(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
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 336
* 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
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 336
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
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 336
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 336
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 336
* 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
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 336
* 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 336
* 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 336
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 336
* 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
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 336
* 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 336
* 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 336
* 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
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 336
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
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 336
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 336
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
336 -
(
view)
(
annotate)
-
[selected]
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
(TestLayer.test_empty_layer): Create an empty
DBFfile too because Thuban layers can't yet cope missing DBF
files.
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.