本文整理汇总了Python中sourcetree.SourceTree.patch_from_commit方法的典型用法代码示例。如果您正苦于以下问题:Python SourceTree.patch_from_commit方法的具体用法?Python SourceTree.patch_from_commit怎么用?Python SourceTree.patch_from_commit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sourcetree.SourceTree
的用法示例。
在下文中一共展示了SourceTree.patch_from_commit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ChapterTest
# 需要导入模块: from sourcetree import SourceTree [as 别名]
# 或者: from sourcetree.SourceTree import patch_from_commit [as 别名]
#.........这里部分代码省略.........
def start_dev_server(self):
self.run_command(Command('python3 manage.py runserver'))
self.dev_server_running = True
time.sleep(1)
def restart_dev_server(self):
print('restarting dev server')
self.run_command(Command('pkill -f runserver'))
time.sleep(1)
self.start_dev_server()
time.sleep(1)
def run_unit_tests(self):
if os.path.exists(os.path.join(self.tempdir, 'superlists', 'accounts', 'tests')):
return self.run_command(Command("python3 manage.py test lists accounts"))
else:
return self.run_command(Command("python3 manage.py test lists"))
def run_fts(self):
if os.path.exists(os.path.join(self.tempdir, 'superlists', 'functional_tests')):
return self.run_command(Command("python3 manage.py test functional_tests"))
else:
return self.run_command(Command("python3 functional_tests.py"))
def recognise_listing_and_process_it(self):
listing = self.listings[self.pos]
if listing.dofirst:
print("DOFIRST", listing.dofirst)
self.sourcetree.patch_from_commit(
listing.dofirst,
)
if listing.skip:
print("SKIP")
listing.was_checked = True
listing.was_written = True
self.pos += 1
elif listing.type == 'test':
print("TEST RUN")
self.run_test_and_check_result()
elif listing.type == 'git diff':
print("GIT DIFF")
self.check_diff_or_status(self.pos)
elif listing.type == 'git status':
print("STATUS")
self.check_diff_or_status(self.pos)
elif listing.type == 'git commit':
print("COMMIT")
self.check_commit(self.pos)
elif listing.type == 'interactive manage.py':
print("INTERACTIVE MANAGE.PY")
output_before = self.listings[self.pos + 1]
assert isinstance(output_before, Output)
LIKELY_INPUTS = ('yes', 'no', '1', '2', "''")
user_input = self.listings[self.pos + 2]
if isinstance(user_input, Command) and user_input in LIKELY_INPUTS:
if user_input == 'yes':
print('yes case')
# in this case there is moar output after the yes
output_after = self.listings[self.pos + 3]
示例2: ChapterTest
# 需要导入模块: from sourcetree import SourceTree [as 别名]
# 或者: from sourcetree.SourceTree import patch_from_commit [as 别名]
#.........这里部分代码省略.........
ignore_errors = True
else:
ignore_errors = False
else:
user_input = None
expected_output = output_before
output_after = None
ignore_errors = True
next_output = None
output = self.run_command(listing, user_input=user_input, ignore_errors=ignore_errors)
self.assert_console_output_correct(output, expected_output)
listing.was_checked = True
output_before.was_checked = True
self.pos += 2
if user_input is not None:
user_input.was_run = True
self.pos += 1
if output_after is not None:
output_after.was_checked = True
self.pos += 1
if next_output is not None:
self.pos += 2
next_output.was_checked = True
first_input.was_run = True
next_input.was_run = True
def recognise_listing_and_process_it(self):
listing = self.listings[self.pos]
if listing.dofirst:
print("DOFIRST", listing.dofirst)
self.sourcetree.patch_from_commit(
listing.dofirst,
)
if listing.skip:
print("SKIP")
listing.was_checked = True
listing.was_written = True
self.pos += 1
elif listing.against_server and not DO_SERVER_COMMANDS:
print("SKIP AGAINST SERVER")
listing.was_checked = True
listing.was_run = True
self.pos += 1
elif listing.type == 'test':
print("TEST RUN")
self.run_test_and_check_result()
elif listing.type == 'bdd test':
print("BDD TEST RUN")
self.run_test_and_check_result(bdd=True)
elif listing.type == 'git diff':
print("GIT DIFF")
self.check_diff_or_status(self.pos)
elif listing.type == 'git status':
print("STATUS")
self.check_diff_or_status(self.pos)
elif listing.type == 'git commit':
print("COMMIT")
self.check_commit(self.pos)
elif listing.type == 'interactive manage.py':
print("INTERACTIVE MANAGE.PY")
self.run_interactive_manage_py(listing)
elif listing.type == 'tree':
print("TREE")