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), )
def test_init_annex_success(self): """init_annex should work on an initialized git-annex repo.""" self.repo = init_annex(self.repo.workdir)
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())
def test_init_annex_version_string(self): """Strings shouldn't be valid versions.""" with self.assertRaises(ValueError): init_annex(str(self.tempdir), version='foo')
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')
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)
def test_init_annex_nonexistent(self): """init_annex shouldn't work on nonexistent directories.""" with self.assertRaises(NotAGitRepoError): init_annex(str(self.tempdir / 'nonexistent'))
def test_init_annex_raises(self): """init_annex shouldn't work on empty directories.""" with self.assertRaises(NotAGitRepoError): init_annex(str(self.tempdir))
def setUp(self): super().setUp() self.repo = git_annex_adapter.init_annex(self.repo.workdir)
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')