Convert makefile tests to python