Esempio n. 1
0
def init_file():
    try:
        repo = FileRepository()
        repo.initialize('.')
    except RepositoryAlreadyExists:
        print("Error: Repository already exists at the current location")
        usage()
Esempio n. 2
0
 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
Esempio n. 3
0
 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)
Esempio n. 4
0
 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)
Esempio n. 5
0
 def setup_existing_repository(self):
     self.existing_repository = 'test_existing_repository'
     repo = FileRepository()
     repo.initialize(self.existing_repository)