def test_geonode_from_db_row(geonode1): # Tests GeoNode constructor from_db_row db_row = (1, 'POINT(-0.84571884220576 51.2945043901003)', 'Node 1') act_node = GeoNode.from_db_row(db_row) assert_geonode(geonode1, act_node) return
def node_details(self, node_id): # Gets full details from node table for id = node_id # Arguments: # node_id - a node id # Returns - a GeoNode object populated with full node details sql = 'SELECT id, ST_AsText(coordinates), name ' \ 'FROM node ' \ 'WHERE id = ' + str(node_id) row = self._execute_query(sql) return GeoNode.from_db_row(row)