def init_file(): try: repo = FileRepository() repo.initialize('.') except RepositoryAlreadyExists: print("Error: Repository already exists at the current location") usage()
def test_initialize_existing_repo_failure(self): """Testing that evolve fails when trying to initialize an existing repo.""" try: repo = FileRepository() repo.initialize(self.existing_repository) self.fail("Expected RepositoryAlreadyExists exception") except RepositoryAlreadyExists, e: pass
def test_initialize_existing_directory(self): """Testing that evolve initializes a repository in an existing directory.""" repo = FileRepository() repo.initialize(self.existing_directory) self.assertRepo(self.existing_directory)
def test_initialize_new_directory(self): """Testing that evolve initializes a repository in a directory that does not exist.""" repo = FileRepository() repo.initialize(self.new_directory) self.assertRepoDir(self.new_directory)
def setup_existing_repository(self): self.existing_repository = 'test_existing_repository' repo = FileRepository() repo.initialize(self.existing_repository)