restructure functional tests with unittest