/[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 845 by bh, Tue May 6 18:05:13 2003 UTC revision 849 by bh, Wed May 7 11:55:31 2003 UTC
# Line 67  class TestTransientTable(unittest.TestCa Line 67  class TestTransientTable(unittest.TestCa
67          self.failIf(table.HasColumn("non_existing_name"))          self.failIf(table.HasColumn("non_existing_name"))
68          self.failIf(table.HasColumn(100))          self.failIf(table.HasColumn(100))
69    
70          # Read an `interesting' record          # Reading rows and values.
71          self.assertEquals(table.ReadRowAsDict(144),          self.assertEquals(table.ReadRowAsDict(144),
72                            {'POPYCOUN': 'IC', 'POPYADMIN': '', 'PONET_': 146,                            {'POPYCOUN': 'IC', 'POPYADMIN': '', 'PONET_': 146,
73                             'AREA': 19.462,                             'AREA': 19.462,
74                             'POPYTYPE': 1, 'PERIMETER': 88.518000000000001,                             'POPYTYPE': 1, 'PERIMETER': 88.518000000000001,
75                             'POPYREG': '1',                             'POPYREG': '1',
76                             'PONET_ID': 145})                             'PONET_ID': 145})
77            self.assertEquals(table.ReadValue(144, "AREA"), 19.462)
78            self.assertEquals(table.ReadValue(144, 3), 145)
79    
80          # ValueRange may induce a copy to the transient database.          # ValueRange may induce a copy to the transient database.
81          # Therefore we put it last so that we can execute this method          # Therefore we put it last so that we can execute this method
# Line 165  class TestTransientTable(unittest.TestCa Line 167  class TestTransientTable(unittest.TestCa
167          self.failIf(table.HasColumn("non_existing_name"))          self.failIf(table.HasColumn("non_existing_name"))
168          self.failIf(table.HasColumn(100))          self.failIf(table.HasColumn(100))
169    
170          # Read an `interesting' record          # Reading rows and values
171          self.assertEquals(table.ReadRowAsDict(22),          self.assertEquals(table.ReadRowAsDict(22),
172                            {'PERIMETER': 0.0, 'CLPOINT_': 23,                            {'PERIMETER': 0.0, 'CLPOINT_': 23,
173                             'AREA': 0.0, 'CLPTLABEL': 'RUINS',                             'AREA': 0.0, 'CLPTLABEL': 'RUINS',
174                             'CLPOINT_ID': 38, 'CLPTFLAG': 0,                             'CLPOINT_ID': 38, 'CLPTFLAG': 0,
175                             'code': 1, 'type': 'RUINS'})                             'code': 1, 'type': 'RUINS'})
176            self.assertEquals(table.ReadValue(22, "type"), 'RUINS')
177            self.assertEquals(table.ReadValue(22, 7), 1)
178    
179          # The transient_table method should return the table itself          # The transient_table method should return the table itself
180          self.assert_(table is table.transient_table())          self.assert_(table is table.transient_table())

Legend:
Removed from v.845  
changed lines
  Added in v.849

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26