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

Diff of /branches/WIP-pyshapelib-bramz/test/test_session.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 987 by bh, Thu May 22 16:46:14 2003 UTC revision 1039 by bh, Mon May 26 17:31:24 2003 UTC
# Line 29  from Thuban.Model.proj import Projection Line 29  from Thuban.Model.proj import Projection
29  from Thuban.Model.color import Color  from Thuban.Model.color import Color
30  from Thuban.Model.table import MemoryTable, FIELDTYPE_STRING, \  from Thuban.Model.table import MemoryTable, FIELDTYPE_STRING, \
31                                 FIELDTYPE_INT, FIELDTYPE_DOUBLE                                 FIELDTYPE_INT, FIELDTYPE_DOUBLE
32    from Thuban.Model.data import DerivedShapeStore
33    
34    
35  class TestSessionSimple(unittest.TestCase):  class TestSessionSimple(unittest.TestCase):
36    
# Line 69  class TestSessionSimple(unittest.TestCas Line 71  class TestSessionSimple(unittest.TestCas
71          table = session.AddTable(memtable)          table = session.AddTable(memtable)
72          self.assertEquals(session.Tables(), [table])          self.assertEquals(session.Tables(), [table])
73    
74        def test_open_table_file(self):
75            """Test Session.OpenTableFile()"""
76            session = self.session = Session("Test Session")
77            filename = os.path.join("..", "Data", "iceland",
78                                    "roads-line.dbf")
79            table = session.OpenTableFile(filename)
80            self.assertEquals(session.Tables(), [table])
81    
82      def test_remove_table(self):      def test_remove_table(self):
83          """Test Session.RemoveTable()"""          """Test Session.RemoveTable()"""
84          session = self.session = Session("Test Session")          session = self.session = Session("Test Session")
# Line 103  class TestSessionSimple(unittest.TestCas Line 113  class TestSessionSimple(unittest.TestCas
113    
114          self.assertEquals(session.Tables(), [store.Table()])          self.assertEquals(session.Tables(), [store.Table()])
115    
116        def test_add_shapestore(self):
117            """Test Session.AddShapeStore()"""
118            session = self.session = Session("Test Session")
119            filename = os.path.join("..", "Data", "iceland",
120                                    "roads-line.shp")
121            try:
122                store = session.OpenShapefile(filename)
123                derived = DerivedShapeStore(store, store.Table())
124                session.AddShapeStore(derived)
125                self.assertEquals(session.ShapeStores(), [store, derived])
126            finally:
127                store = derived = None
128    
129    
130  class TestSessionBase(unittest.TestCase, support.SubscriberMixin):  class TestSessionBase(unittest.TestCase, support.SubscriberMixin):
131    

Legend:
Removed from v.987  
changed lines
  Added in v.1039

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26