Put tests in correct file and add test for add_repository