def test(self,verbose=True):
        PREFIX = 'spiderosm_test_'
        TABLE1 = PREFIX + '1_'
        TABLE2 = PREFIX + '2_'
        TABLE_SEGS = PREFIX + 'segs_'
        TABLE_JCTS = PREFIX + 'jcts_'

        ref = self._interpolation_ref
	self.exec_sql('drop table if exists %s' % TABLE1)
        self.exec_sql('create table %s ("a:f1" text, other integer, test_key serial primary key)' % TABLE1)
        self.exec_sql('insert into  %s ("a:f1", other) values (%s, %s)' % (TABLE1,ref,ref),
                ('''foo's"''', 1))
        self.exec_sql('''insert into %s ("a:f1", other) values ('bar', 5)''' % TABLE1)
        self.exec_sql(TABLE1 % '''insert into %s ("a:f1") values ('zar')''')
	table = self.get_table(TABLE1)

	assert len(table)==3
	assert table[1]['other']==5
        assert table[2]['a:f1']=='zar'
	assert len(table) == self.get_num_rows(TABLE1)
        col_names = self.get_column_names(TABLE1)
        assert col_names == ['a:f1', 'other', 'test_key']
        # another way to get col_names (but in random order)
        assert len(table[0].keys()) == 3

        #add_geometry_column
        self.add_geometry_column(TABLE1,'geometry','POINT')
        assert self.get_column_names(TABLE1) == ['a:f1', 'geometry', 'other', 'test_key']

        # write_table        
        col_specs = [('id', 'BIGINT'), ('a:name', 'TEXT'), ('length', 'FLOAT'), ('geometry', 'POINT')]
        rows = []
        rows.append({ 'id':1, 'a:name':'dianna', 'length':5.3})
        rows.append({ 'id':2, 'a:name':'nathan'})
        rows.append([3,'michael',5.10, (-122.0, 38.0)])
        rows.append({ 'id':4, 'a:name':None, 'length':100 })

        self.write_table(TABLE2, col_specs, rows)
        assert  self.get_column_names(TABLE2) == ['a:name', 'geometry', 'id', 'length']

        rowsr = self.get_table(TABLE2)
        assert len(rowsr) == 4
        assert rowsr[0]['a:name'] == 'dianna'
        assert rowsr[2]['id'] == 3
        assert rowsr[1]['length'] == None

        # geo
        geometry = geojson.Point((-122.0,38.0))
        ls = geojson.LineString([(-122,38),(-122,39)])
        features = [
            geojson.Feature(geometry=geometry, id=1, properties={'name':'john','addr':1212, 'gpa':3.5}),
            geojson.Feature(geometry=geometry, id=2, properties={'fish':'salmon', 'addr':'sea', 'gpa':3, 'foo':None}),
            geojson.Feature(geometry=ls, id=10, properties={'other':10}),
            geojson.Feature(geometry=geometry, id=3, properties={'num':2**40}),
            geojson.Feature(geometry=geometry, id=4, properties={'Num':2}),
            geojson.Feature(geometry=geometry, id=5, properties={'NUM':'many'})
            ]
        geo = geojson.FeatureCollection(features)
        
        #write_geo
        self.write_geo(geo, TABLE_SEGS, geometry_type='LineString')
        self.write_geo(geo, TABLE_JCTS, geometry_type='Point')
        
        # table_names
        table_names = self.get_table_names()

        #print 'table_names:',table_names
        assert TABLE1 in table_names

        # check for spatial extension
        assert 'spatial_ref_sys' in self.get_table_names()

        # check for srid
        rows = self.select('*','spatial_ref_sys','srid=%d'%self.srid)
        assert len(rows) == 1

        # clean up
        self.drop_table(TABLE1)
        self.drop_table(TABLE2)
        self.drop_table(TABLE_SEGS)
        self.drop_table(TABLE_JCTS)
      
        self.commit()
dataset/ETHPy150Open mharnold/spiderosm/spiderosm/dbinterface.py/DatabaseInterface.test/swapped operands of `%`