/[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 765 by bh, Tue Apr 29 12:42:14 2003 UTC revision 785 by bh, Wed Apr 30 10:54:03 2003 UTC
# Line 172  class TestTransientTable(unittest.TestCa Line 172  class TestTransientTable(unittest.TestCa
172          self.assert_(table is table.transient_table())          self.assert_(table is table.transient_table())
173    
174    
175        def test_transient_table_read_twice(self):
176            """Test TransientTable.read_record() reading the same record twice"""
177            simple = SimpleTable([("type", FIELDTYPE_STRING),
178                                  ("code", FIELDTYPE_INT)],
179                                 [("OTHER/UNKNOWN", 0),
180                                  ("RUINS", 1),
181                                  ("FARM", 2),
182                                  ("BUILDING", 3),
183                                  ("HUT", 4),
184                                  ("LIGHTHOUSE", 5)])
185            table = TransientTable(self.transientdb, simple)
186    
187            # There was a bug where reading the same record twice would
188            # raise an exception in the second call because of an
189            # unitialized local variable, so for passing the test it's
190            # enough if reading simply succeeds. OTOH, while we're at it we
191            # might as well check whether the results are equal anyway :)
192            result1 = table.read_record(3)
193            result2 = table.read_record(3)
194            self.assertEquals(result1, result2)
195    
196  if __name__ == "__main__":  if __name__ == "__main__":
197      support.run_tests()      support.run_tests()

Legend:
Removed from v.765  
changed lines
  Added in v.785

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26