本文整理匯總了Python中datalad.support.annexrepo.AnnexRepo.annex_get方法的典型用法代碼示例。如果您正苦於以下問題:Python AnnexRepo.annex_get方法的具體用法?Python AnnexRepo.annex_get怎麽用?Python AnnexRepo.annex_get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類datalad.support.annexrepo.AnnexRepo
的用法示例。
在下文中一共展示了AnnexRepo.annex_get方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_AnnexRepo_file_has_content
# 需要導入模塊: from datalad.support.annexrepo import AnnexRepo [as 別名]
# 或者: from datalad.support.annexrepo.AnnexRepo import annex_get [as 別名]
def test_AnnexRepo_file_has_content(src, annex_path):
ar = AnnexRepo(annex_path, src)
testfiles = ["test-annex.dat", "test.dat"]
assert_equal(ar.file_has_content(testfiles),
[("test-annex.dat", False), ("test.dat", False)])
ar.annex_get("test-annex.dat")
assert_equal(ar.file_has_content(testfiles),
[("test-annex.dat", True), ("test.dat", False)])
示例2: test_AnnexRepo_get
# 需要導入模塊: from datalad.support.annexrepo import AnnexRepo [as 別名]
# 或者: from datalad.support.annexrepo.AnnexRepo import annex_get [as 別名]
def test_AnnexRepo_get(src, dst):
ar = AnnexRepo(dst, src)
assert_is_instance(ar, AnnexRepo, "AnnexRepo was not created.")
testfile = 'test-annex.dat'
testfile_abs = os.path.join(dst, testfile)
assert_false(ar.file_has_content("test-annex.dat")[0][1])
ar.annex_get(testfile)
assert_true(ar.file_has_content("test-annex.dat")[0][1])
f = open(testfile_abs, 'r')
assert_equal(f.readlines(), ['123\n'], "test-annex.dat's content doesn't match.")