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

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

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

revision 984 by bh, Thu May 22 16:37:48 2003 UTC revision 1041 by bh, Mon May 26 19:26:41 2003 UTC
# Line 50  class TestTransientTable(unittest.TestCa Line 50  class TestTransientTable(unittest.TestCa
50          self.assertEquals(table.NumRows(), 156)          self.assertEquals(table.NumRows(), 156)
51          self.assertEquals(table.NumColumns(), 8)          self.assertEquals(table.NumColumns(), 8)
52    
53          # Check one each of the possible field types. The width and          # Check one each of the possible field types.
         # decimal precision is always 0.  
54          columns = table.Columns()          columns = table.Columns()
55          self.assertEquals(columns[0].name, 'AREA')          self.assertEquals(columns[0].name, 'AREA')
56          self.assertEquals(columns[0].type, FIELDTYPE_DOUBLE)          self.assertEquals(columns[0].type, FIELDTYPE_DOUBLE)
# Line 101  class TestTransientTable(unittest.TestCa Line 100  class TestTransientTable(unittest.TestCa
100          # The transient_table method should return the table itself          # The transient_table method should return the table itself
101          self.assert_(table is table.transient_table())          self.assert_(table is table.transient_table())
102    
103            # The title is simply copied over from the original table
104            self.assertEquals(table.Title(), orig_table.Title())
105    
106          # The TransientTable class itself doesn't implement the          # The TransientTable class itself doesn't implement the
107          # Dependencies method, so we don't test it.          # Dependencies method, so we don't test it.
108    
# Line 150  class TestTransientTable(unittest.TestCa Line 152  class TestTransientTable(unittest.TestCa
152          table = AutoTransientTable(self.transientdb, orig_table)          table = AutoTransientTable(self.transientdb, orig_table)
153          self.assertEquals(table.Dependencies(), (orig_table,))          self.assertEquals(table.Dependencies(), (orig_table,))
154    
155        def test_auto_transient_table_title(self):
156            """Test AutoTransientTable.Title()"""
157            orig_table = DBFTable(os.path.join("..", "Data", "iceland",
158                                               "political.dbf"))
159            table = AutoTransientTable(self.transientdb, orig_table)
160            # The title is of course the same as that of the original table
161            self.assertEquals(table.Title(), orig_table.Title())
162    
163      def test_transient_joined_table(self):      def test_transient_joined_table(self):
164          """Test TransientJoinedTable"""          """Test TransientJoinedTable"""
165          simple = MemoryTable([("type", FIELDTYPE_STRING),          simple = MemoryTable([("type", FIELDTYPE_STRING),
# Line 198  class TestTransientTable(unittest.TestCa Line 208  class TestTransientTable(unittest.TestCa
208          # The TransientJoinedTable depends on both input tables          # The TransientJoinedTable depends on both input tables
209          self.assertEquals(table.Dependencies(), (landmarks, auto))          self.assertEquals(table.Dependencies(), (landmarks, auto))
210    
211            # The title is constructed from the titles of the input tables.
212            self.assertEquals(table.Title(),
213                              "Join of %s and %s" % (landmarks.Title(),
214                                                     auto.Title()))
215    
216    
217      def test_transient_table_read_twice(self):      def test_transient_table_read_twice(self):
218          """Test TransientTable.ReadRowAsDict() reading the same record twice"""          """Test TransientTable.ReadRowAsDict() reading the same record twice"""

Legend:
Removed from v.984  
changed lines
  Added in v.1041

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26