Unit test refactoring for travis-ci