コード例 #1
0
 def test_init_annex_description(self):
     """init_annex with description should update uuid.log."""
     repo = init_annex(str(self.tempdir), description='foo')
     uuid = repo.config['annex.uuid']
     uuid_log_blob = repo.revparse_single('git-annex:uuid.log')
     self.assertIn(
         "{} {} timestamp=".format(uuid, 'foo'),
         str(uuid_log_blob.data),
     )
コード例 #2
0
 def test_init_annex_success(self):
     """init_annex should work on an initialized git-annex repo."""
     self.repo = init_annex(self.repo.workdir)
コード例 #3
0
 def test_init_annex_success(self):
     """init_annex should work on a new git repo."""
     annex_repo = init_annex(self.repo.workdir)
     self.assertIsInstance(annex_repo, GitAnnexRepo)
     self.assertIn('git-annex', annex_repo.listall_branches())
コード例 #4
0
 def test_init_annex_version_string(self):
     """Strings shouldn't be valid versions."""
     with self.assertRaises(ValueError):
         init_annex(str(self.tempdir), version='foo')
コード例 #5
0
 def test_init_annex_version_six(self):
     """Repository version 6 should be valid."""
     annex_repo = init_annex(str(self.tempdir), version=6)
     self.assertGreaterEqual(annex_repo.config['annex.version'], '6')
コード例 #6
0
 def test_init_annex_version_negative(self):
     """Negative numbers shouldn't be valid versions."""
     with self.assertRaises(ValueError):
         init_annex(str(self.tempdir), version=-1)
コード例 #7
0
 def test_init_annex_nonexistent(self):
     """init_annex shouldn't work on nonexistent directories."""
     with self.assertRaises(NotAGitRepoError):
         init_annex(str(self.tempdir / 'nonexistent'))
コード例 #8
0
 def test_init_annex_raises(self):
     """init_annex shouldn't work on empty directories."""
     with self.assertRaises(NotAGitRepoError):
         init_annex(str(self.tempdir))
コード例 #9
0
ファイル: utils.py プロジェクト: willmerae/git-annex-adapter
 def setUp(self):
     super().setUp()
     self.repo = git_annex_adapter.init_annex(self.repo.workdir)
コード例 #10
0
 def test_init_annex_version_five(self):
     """Repository version 5 should be valid."""
     annex_repo = init_annex(str(self.tempdir), version=5)
     self.assertEqual(annex_repo.config['annex.version'], '5')