本文整理汇总了Python中app.project_type.git.Git.project_directory方法的典型用法代码示例。如果您正苦于以下问题:Python Git.project_directory方法的具体用法?Python Git.project_directory怎么用?Python Git.project_directory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app.project_type.git.Git
的用法示例。
在下文中一共展示了Git.project_directory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_execute_command_in_project_type_specifies_cwd_if_doesnt_exist
# 需要导入模块: from app.project_type.git import Git [as 别名]
# 或者: from app.project_type.git.Git import project_directory [as 别名]
def test_execute_command_in_project_type_specifies_cwd_if_doesnt_exist(self):
project_type_popen_patch = self._patch_popen()
git_env = Git("ssh://scm.dev.box.net/box/www/current", 'origin', 'refs/changes/78/151978/27')
git_env.project_directory = 'proj_dir'
git_env.execute_command_in_project('some_command')
project_type_popen_patch.assert_called_once_with(
'export PROJECT_DIR="proj_dir"; some_command',
cwd=None,
shell=ANY,
stdout=ANY,
stderr=ANY,
start_new_session=ANY,
)
示例2: test_execute_command_in_project_type_specifies_cwd_if_doesnt_exist
# 需要导入模块: from app.project_type.git import Git [as 别名]
# 或者: from app.project_type.git.Git import project_directory [as 别名]
def test_execute_command_in_project_type_specifies_cwd_if_doesnt_exist(self):
project_type_popen_patch = self._patch_popen()
fake_project_directory = 'proj_dir'
fake_command = 'some_command'
git_env = Git("ssh://scm.dev.box.net/box/www/current", 'origin', 'refs/changes/78/151978/27')
git_env.project_directory = fake_project_directory
git_env.execute_command_in_project(fake_command)
env_setter = get_environment_variable_setter_command('PROJECT_DIR', fake_project_directory)
project_type_popen_patch.assert_called_once_with(
'{} {}'.format(env_setter, fake_command),
cwd=None,
shell=ANY,
stdout=ANY,
stderr=ANY,
start_new_session=ANY,
)
示例3: test_execute_command_in_project_type_specifies_cwd_if_doesnt_exist
# 需要导入模块: from app.project_type.git import Git [as 别名]
# 或者: from app.project_type.git.Git import project_directory [as 别名]
def test_execute_command_in_project_type_specifies_cwd_if_doesnt_exist(self):
os_path_exists_patch = self.patch('os.path.exists')
os_path_exists_patch.return_value = False
project_type_popen_patch = self.patch('app.project_type.project_type.Popen')
project_type_popen_patch.return_value.communicate.return_value = None, None
project_type_popen_patch.return_value.returncode = 0
git_env = Git("ssh://scm.dev.box.net/box/www/current", 'origin', 'refs/changes/78/151978/27')
git_env.project_directory = 'proj_dir'
git_env.execute_command_in_project('some_command')
project_type_popen_patch.assert_called_once_with(
'export PROJECT_DIR="proj_dir"; some_command',
stderr=-2,
cwd=None,
shell=True,
stdout=-1
)