本文整理汇总了Python中biomaj.bank.Bank.update方法的典型用法代码示例。如果您正苦于以下问题:Python Bank.update方法的具体用法?Python Bank.update怎么用?Python Bank.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类biomaj.bank.Bank
的用法示例。
在下文中一共展示了Bank.update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_computed_ref_release
# 需要导入模块: from biomaj.bank import Bank [as 别名]
# 或者: from biomaj.bank.Bank import update [as 别名]
def test_computed_ref_release(self):
b = Bank('computed2')
res = b.update(True)
self.assertTrue(b.session.get('update'))
b2 = Bank('computed2')
res = b2.update(True)
self.assertFalse(b2.session.get('update'))
示例2: test_update_hardlinks
# 需要导入模块: from biomaj.bank import Bank [as 别名]
# 或者: from biomaj.bank.Bank import update [as 别名]
def test_update_hardlinks(self):
"""
Update a bank twice with hard links^. Files copied from previous release
must be links.
"""
b = Bank('local')
b.config.set('keep.old.version', '3')
b.config.set('use_hardlinks', '1')
# First update
b.update()
self.assertTrue(b.session.get('update'))
old_release = b.session.get_full_release_directory()
# Update test.fasta to force update (not that this file is modified in the
# source tree)
remote_file = b.session.config.get('remote.dir') + 'test.fasta.gz'
stat = os.stat(remote_file)
one_day = 3600 * 24
os.utime(remote_file, (stat.st_atime + one_day, stat.st_atime + one_day))
# Second update
b.update()
self.assertTrue(b.session.get('update'))
new_release = b.session.get_full_release_directory()
# Test that test2.fasta in both release are the same file (we can't use
# test.fasta because it is uncompressed and then not the same file)
file_old_release = os.path.join(old_release, 'flat', 'test2.fasta')
file_new_release = os.path.join(new_release, 'flat', 'test2.fasta')
try:
self.assertTrue(os.path.samefile(file_old_release, file_new_release))
except AssertionError:
msg = "In %s: copy worked but hardlinks were not used." % self.id()
logging.info(msg)
# Restore date (otherwise repeated tests fail)
os.utime(remote_file, (stat.st_atime, stat.st_atime))
示例3: test_removeAll
# 需要导入模块: from biomaj.bank import Bank [as 别名]
# 或者: from biomaj.bank.Bank import update [as 别名]
def test_removeAll(self):
b = Bank('local')
b.update()
b.removeAll()
self.assertFalse(os.path.exists(b.get_data_dir()))
bdb = b.banks.find_one({'name': b.name})
self.assertTrue(bdb is None)
示例4: test_stats
# 需要导入模块: from biomaj.bank import Bank [as 别名]
# 或者: from biomaj.bank.Bank import update [as 别名]
def test_stats(self):
b = Bank("local")
b.update()
rel = b.session.get("release")
stats = Bank.get_banks_disk_usage()
self.assertTrue(stats[0]["size"] > 0)
for release in stats[0]["releases"]:
if release["name"] == rel:
self.assertTrue(release["size"] > 0)
示例5: test_stats
# 需要导入模块: from biomaj.bank import Bank [as 别名]
# 或者: from biomaj.bank.Bank import update [as 别名]
def test_stats(self):
b = Bank('local')
b.update()
rel = b.session.get('release')
stats = Bank.get_banks_disk_usage()
self.assertTrue(stats[0]['size']>0)
for release in stats[0]['releases']:
if release['name'] == rel:
self.assertTrue(release['size']>0)
示例6: test_no_update
# 需要导入模块: from biomaj.bank import Bank [as 别名]
# 或者: from biomaj.bank.Bank import update [as 别名]
def test_no_update(self):
'''
Try updating twice, at second time, bank should not be updated
'''
b = Bank('local')
b.update()
self.assertTrue(b.session.get('update'))
b.update()
self.assertFalse(b.session.get('update'))
self.assertFalse(b.session.get_status(Workflow.FLOW_POSTPROCESS))
示例7: test_reupdate_from_task_wrong_release
# 需要导入模块: from biomaj.bank import Bank [as 别名]
# 或者: from biomaj.bank.Bank import update [as 别名]
def test_reupdate_from_task_wrong_release(self):
b = Bank("local")
b.options.stop_after = "download"
b.update()
self.assertFalse(b.session.get_status("postprocess"))
b2 = Bank("local")
b2.options.from_task = "postprocess"
b2.options.release = "wrongrelease"
res = b2.update()
self.assertFalse(res)
示例8: test_reupdate_from_task_error
# 需要导入模块: from biomaj.bank import Bank [as 别名]
# 或者: from biomaj.bank.Bank import update [as 别名]
def test_reupdate_from_task_error(self):
b = Bank("local")
b.options.stop_after = "check"
b.update()
self.assertFalse(b.session.get_status("postprocess"))
b2 = Bank("local")
b2.options.from_task = "postprocess"
b2.options.release = b.session.get("release")
res = b2.update()
self.assertFalse(res)
示例9: test_reupdate_from_task_error
# 需要导入模块: from biomaj.bank import Bank [as 别名]
# 或者: from biomaj.bank.Bank import update [as 别名]
def test_reupdate_from_task_error(self):
b = Bank('local')
b.options.stop_after = 'check'
b.update()
self.assertFalse(b.session.get_status('postprocess'))
b2 = Bank('local')
b2.options.from_task = 'postprocess'
b2.options.release = b.session.get('release')
res = b2.update()
self.assertFalse(res)
示例10: test_no_update
# 需要导入模块: from biomaj.bank import Bank [as 别名]
# 或者: from biomaj.bank.Bank import update [as 别名]
def test_no_update(self):
"""
Try updating twice, at second time, bank should not be updated
"""
b = Bank("local")
b.update()
self.assertTrue(b.session.get("update"))
b.update()
self.assertFalse(b.session.get("update"))
self.assertFalse(b.session.get_status(Workflow.FLOW_POSTPROCESS))
示例11: test_reupdate_from_task_wrong_release
# 需要导入模块: from biomaj.bank import Bank [as 别名]
# 或者: from biomaj.bank.Bank import update [as 别名]
def test_reupdate_from_task_wrong_release(self):
b = Bank('local')
b.options.stop_after = 'download'
b.update()
self.assertFalse(b.session.get_status('postprocess'))
b2 = Bank('local')
b2.options.from_task = 'postprocess'
b2.options.release = 'wrongrelease'
res = b2.update()
self.assertFalse(res)
示例12: test_computed
# 需要导入模块: from biomaj.bank import Bank [as 别名]
# 或者: from biomaj.bank.Bank import update [as 别名]
def test_computed(self):
b = Bank('computed')
res = b.update(True)
self.assertTrue(res)
self.assertTrue(os.path.exists(b.session.get_full_release_directory()+'/sub1/flat/test_100.txt'))
self.assertTrue(b.session.get('update'))
# Check that, with depends non updated, bank is not updated itself
nextb = Bank('computed')
res = nextb.update(True)
self.assertFalse(nextb.session.get('update'))
示例13: test_reupdate_from_task
# 需要导入模块: from biomaj.bank import Bank [as 别名]
# 或者: from biomaj.bank.Bank import update [as 别名]
def test_reupdate_from_task(self):
b = Bank("local")
b.options.stop_after = "download"
b.update()
self.assertFalse(b.session.get_status("postprocess"))
b2 = Bank("local")
b2.options.from_task = "postprocess"
b2.options.release = b.session.get("release")
b2.update()
self.assertTrue(b2.session.get_status("postprocess"))
self.assertEqual(b.session.get_full_release_directory(), b2.session.get_full_release_directory())
示例14: test_search
# 需要导入模块: from biomaj.bank import Bank [as 别名]
# 或者: from biomaj.bank.Bank import update [as 别名]
def test_search(self):
b = Bank('localprocess')
b.update()
search_res = Bank.search(['blast'],[])
self.assertTrue(len(search_res)==1)
search_res = Bank.search([],['nucleic'])
self.assertTrue(len(search_res)==1)
search_res = Bank.search(['blast'],['nucleic'])
self.assertTrue(len(search_res)==1)
search_res = Bank.search(['blast'],['proteic'])
self.assertTrue(len(search_res)==0)
示例15: test_search
# 需要导入模块: from biomaj.bank import Bank [as 别名]
# 或者: from biomaj.bank.Bank import update [as 别名]
def test_search(self):
b = Bank("localprocess")
b.update()
search_res = Bank.search(["blast"], [])
self.assertTrue(len(search_res) == 1)
search_res = Bank.search([], ["nucleic"])
self.assertTrue(len(search_res) == 1)
search_res = Bank.search(["blast"], ["nucleic"])
self.assertTrue(len(search_res) == 1)
search_res = Bank.search(["blast"], ["proteic"])
self.assertTrue(len(search_res) == 0)