How to zoom to a selected feature with pyQGIS
You need to set the extents of the map canvas to the extents of the selections:
box = layer.boundingBoxOfSelected()
iface.mapCanvas().setExtent(box)
iface.mapCanvas().refresh()
Zoom to selected features can also be performed by triggering the "Zoom to Selection" option of View menu.
eMenu = self.iface.viewMenu()
eMenu.actions() [12].trigger()
Note: The index number may vary with different QGIS versions.
Or more directly:
iface.actionZoomToSelected().trigger()