Refactoring tests to make things more straightforward

I didn't managed to make parametrised tests with unittest but that should be the real solution.
Also, I don't know how to test the hook : it doesn't seem to work :/