/[thuban]/trunk/thuban/test/test_save.py
ViewVC logotype

Log of /trunk/thuban/test/test_save.py

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (annotate)
Sticky Revision:

Revision 1268 - (view) (annotate) - [select for diffs]
Modified Fri Jun 20 16:10:12 2003 UTC (21 years, 8 months ago) by bh
File length: 20232 byte(s)
Diff to previous 1259
* Resources/XML/thuban-0.8.dtd: New DTD for the new file format
version.

* Thuban/Model/save.py (sort_data_stores): New. Make topological
sort of the data sources so they can be written with sources that
data sources that depend on other data sources come after the
sources they depend on.
(SessionSaver.__init__): Add idmap instance variable to map from
objects to the ids used in the file.
(SessionSaver.get_id, SessionSaver.define_id)
(SessionSaver.has_id): New. Methods to manage the idmap
(SessionSaver.write): Use thuban-0.8.dtd
(SessionSaver.write_session): Add a namespace on the session and
write out the data sources before the maps.
(SessionSaver.write_data_containers): New. Write the data
containers.
(SessionSaver.write_layer): Layer elements now refer to a
shapestore and don't contain filenames anymore.

* Thuban/Model/load.py (LoadError): Exception class to raise when
errors in the files are discovered
(SessionLoader.__init__): Define dispatchers for elements with a
thuban-0.8 namespace too.
(SessionLoader.check_attrs): New helper method to check and
convert attributes
(AttrDesc): New. Helper class for SessionLoader.check_attrs
(SessionLoader.start_fileshapesource)
(SessionLoader.start_derivedshapesource)
(SessionLoader.start_filetable, SessionLoader.start_jointable):
Handlers for the new elements in the new fileformat
(SessionLoader.start_layer): Handle the shapestore attribute in
addition to filename.
(SessionLoader.start_table, SessionLoader.end_table): Removed.
They were never used in the old formats and aren't needed for the
new.

* Thuban/Model/session.py (Session.DataContainers): New method to
return all "data containers", i.e. shapestores and tables

* test/xmlsupport.py (SaxEventLister.__init__)
(SaxEventLister.startElementNS, sax_eventlist): Add support to
normalize IDs.

* test/test_xmlsupport.py
(TestEventList.test_even_list_id_normalization): New test case for
id normalization

* test/test_load.py (LoadSessionTest.check_format): Use ID
normalization
(LoadSessionTest.thubanids, LoadSessionTest.thubanidrefs): New
class atrributes used for ID normalization
(TestSingleLayer, TestLayerVisibility, TestLabels.test)
(TestLayerProjection.test, TestRasterLayer.test): Adapt to new
file format
(TestJoinedTable): New test for loading sessions with joined
tables.
(TestLoadError): New. Test whether missing required attributes
cause a LoadError.

* test/test_save.py (SaveSessionTest.thubanids)
(SaveSessionTest.thubanidrefs): New class attributes for ID
normalization in .thuban files.
(SaveSessionTest.compare_xml): Use id-normalization.
(SaveSessionTest.testEmptySession)
(SaveSessionTest.testLayerProjection)
(SaveSessionTest.testRasterLayer)
(SaveSessionTest.testClassifiedLayer): Adapt to new file format.
(SaveSessionTest.testLayerProjection): The filename used was the
same as for testSingleLayer. Use a different one.
(SaveSessionTest.test_dbf_table)
(SaveSessionTest.test_joined_table): New test cases for saving the
new data sources structures.
(TestStoreSort, MockDataStore): Classes to test the sorting of the
data stores for writing.


Revision 1259 - (view) (annotate) - [select for diffs]
Modified Fri Jun 20 12:31:48 2003 UTC (21 years, 8 months ago) by bh
File length: 12197 byte(s)
Diff to previous 1245
* test/test_save.py (SaxEventLister, sax_eventlist): Removed. Use
the implementation in xmlsupport instead.
(SaveSessionTest.compare_xml): sax_eventlist is now in xmlsupport

* test/test_proj.py: Import sax_eventlist from xmlsupport instead
of test_save


Revision 1245 - (view) (annotate) - [select for diffs]
Modified Thu Jun 19 19:29:23 2003 UTC (21 years, 8 months ago) by bh
File length: 13268 byte(s)
Diff to previous 1200
Add XML validation to some of the tests. Validation will only be
done if pyRXP is installed (http://reportlab.com/xml/pyrxp.html).
To make the DTD available to the test cases it's moved into
Resources/XML

* Resources/XML/thuban.dtd: New. This is now the real Thuban DTD
for versions up to and including 0.2. Two slight changes: added an
encoding specification and fixed the comment which refered to
GRASS, not Thuban

* test/xmlsupport.py: New support module for tests involving XML.
Currently there's a mix-in class for XML validation.

* test/test_xmlsupport.py: New. Tests for the xmlsupport module

* test/test_save.py (SaveSessionTest): Derive from ValidationTest
so that we can validate the
(SaveSessionTest.testEmptySession)
(SaveSessionTest.testSingleLayer)
(SaveSessionTest.testSingleLayer)
(SaveSessionTest.testLayerProjection)
(SaveSessionTest.testRasterLayer)
(SaveSessionTest.testClassifiedLayer): Validate the generated XML

* test/runtests.py (main): Call print_additional_summary instead
of print_garbage_information

* test/support.py (resource_dir): New function to return the
"Resource" subdirectory
(print_additional_summary): New function to combine several
summary functions
(run_tests): Use print_additional_summary instead of calling
print_garbage_information directly


Revision 1200 - (view) (annotate) - [select for diffs]
Modified Fri Jun 13 15:04:44 2003 UTC (21 years, 8 months ago) by jonathan
File length: 13103 byte(s)
Diff to previous 1173
(XMLWriterTest.Encode): Check return values.  Fixes RTbug #1851.


Revision 1173 - (view) (annotate) - [select for diffs]
Modified Thu Jun 12 13:37:18 2003 UTC (21 years, 8 months ago) by jonathan
File length: 12965 byte(s)
Diff to previous 1168
(XMLWriterTest.testEncode): Explicitly check unicode strings.


Revision 1168 - (view) (annotate) - [select for diffs]
Modified Thu Jun 12 12:42:50 2003 UTC (21 years, 8 months ago) by jonathan
File length: 12843 byte(s)
Diff to previous 947
(SaveSessionTest.testClassifiedLayer): New
        test for saving classified layers. Fixes RTbug #1902.
(XMLWriterTest): New. Tests the XMLWriter class. Fixes RTbug #1851.


Revision 947 - (view) (annotate) - [select for diffs]
Modified Tue May 20 15:27:19 2003 UTC (21 years, 9 months ago) by jonathan
File length: 8620 byte(s)
Diff to previous 775
Added tests associated with the raster layer code.


Revision 775 - (view) (annotate) - [select for diffs]
Modified Tue Apr 29 14:34:57 2003 UTC (21 years, 10 months ago) by jonathan
File length: 7041 byte(s)
Diff to previous 755
SaveSessionTest.testSingleLayer): Add test for saving an invisible layer.


Revision 755 - (view) (annotate) - [select for diffs]
Modified Fri Apr 25 14:48:35 2003 UTC (21 years, 10 months ago) by jonathan
File length: 6454 byte(s)
Diff to previous 723
(SaveSessionTest.testLayerProjection): New test to verify layer projections
        are saved correctly.


Revision 723 - (view) (annotate) - [select for diffs]
Modified Thu Apr 24 15:31:53 2003 UTC (21 years, 10 months ago) by bh
File length: 4439 byte(s)
Diff to previous 530
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 530 - (view) (annotate) - [select for diffs]
Modified Wed Mar 12 19:58:00 2003 UTC (21 years, 11 months ago) by jonathan
File length: 4406 byte(s)
Diff to previous 524
Fixed problem with xml reading that caused exceptions


Revision 524 - (view) (annotate) - [select for diffs]
Modified Wed Mar 12 18:26:55 2003 UTC (21 years, 11 months ago) by jonathan
File length: 4241 byte(s)
Diff to previous 494
Fixed external entity problem.


Revision 494 - (view) (annotate) - [select for diffs]
Modified Mon Mar 10 10:45:33 2003 UTC (22 years ago) by jonathan
File length: 4054 byte(s)
Diff to previous 292
New and improved tests.


Revision 292 - (view) (annotate) - [select for diffs]
Added Fri Aug 30 09:44:12 2002 UTC (22 years, 6 months ago) by bh
File length: 3927 byte(s)
Initial set of tests and
brief instructions on how to run them


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