Added tests and python hooks