示例#1
0
文件: init.py 项目: dreverri/evolve
def init_file():
    try:
        repo = FileRepository()
        repo.initialize('.')
    except RepositoryAlreadyExists:
        print("Error: Repository already exists at the current location")
        usage()
示例#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
示例#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)
示例#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)
示例#5
0
 def setup_existing_repository(self):
     self.existing_repository = 'test_existing_repository'
     repo = FileRepository()
     repo.initialize(self.existing_repository)