Beispiel #1
0
  def test_find_existing_pygit_repo(self):
    os.chdir(self.root_temp_dir + '/one/two/three')
    discovered_pygit_repo_path = utils.find_pygit_repo()
    assert os.path.abspath(discovered_pygit_repo_path) == os.path.abspath(self.pygit_repo_path)

    os.chdir(self.root_temp_dir + '/one')
    discovered_pygit_repo_path = utils.find_pygit_repo()
    assert os.path.abspath(discovered_pygit_repo_path) == os.path.abspath(self.pygit_repo_path)
Beispiel #2
0
  def test_add(self):
    pygit_repo_path = self.root_temp_dir + '/one/'

    os.chdir(self.root_temp_dir + '/one/two/three')
    pygit_repo_path = utils.find_pygit_repo()
    assert os.path.abspath(pygit_repo_path) == os.path.abspath(pygit_repo_path)

    os.chdir(self.root_temp_dir + '/one')
    pygit_repo_path = utils.find_pygit_repo()
    assert os.path.abspath(pygit_repo_path) == os.path.abspath(pygit_repo_path)

    try:
      os.chdir(self.root_temp_dir + '/zero/minus_one')
      pygit_repo_path = utils.find_pygit_repo()
    except utils.RepoNotFoundException:
      assert True
Beispiel #3
0
 def test_find_non_existing_pygit_repo(self):
   try:
     os.chdir(self.root_temp_dir + '/zero/minus_one')
     pygit_repo_path = utils.find_pygit_repo()
   except utils.RepoNotFoundException:
     assert True