Finish porting functional test to python