当前位置: 首页>>代码示例>>Python>>正文


Python Project.build_depends_on_requirements方法代码示例

本文整理汇总了Python中pybuilder.core.Project.build_depends_on_requirements方法的典型用法代码示例。如果您正苦于以下问题:Python Project.build_depends_on_requirements方法的具体用法?Python Project.build_depends_on_requirements怎么用?Python Project.build_depends_on_requirements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pybuilder.core.Project的用法示例。


在下文中一共展示了Project.build_depends_on_requirements方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: InstallBuildDependenciesTest

# 需要导入模块: from pybuilder.core import Project [as 别名]
# 或者: from pybuilder.core.Project import build_depends_on_requirements [as 别名]
    class InstallBuildDependenciesTest(unittest.TestCase):
        def setUp(self):
            self.project = Project("unittest", ".")
            self.project.set_property("dir_install_logs", "any_directory")
            self.logger = mock(Logger)
            initialize_install_dependencies_plugin(self.project)
            when(pybuilder.plugins.python.install_dependencies_plugin).execute_command(any_value(),
                                                                                       any_value(),
                                                                                       env=any_value(),
                                                                                       shell=False).thenReturn(0)

        def tearDown(self):
            unstub()

        def test_should_install_multiple_dependencies(self):
            self.project.build_depends_on("spam")
            self.project.build_depends_on("eggs")
            self.project.build_depends_on_requirements("requirements-dev.txt")

            install_build_dependencies(self.logger, self.project)

            verify(pybuilder.plugins.python.install_dependencies_plugin).execute_command(
                PIP_EXEC_STANZA + ["install", "spam"], any_value(), shell=False)
            verify(pybuilder.plugins.python.install_dependencies_plugin).execute_command(
                PIP_EXEC_STANZA + ["install", "eggs"], any_value(), shell=False)
            verify(pybuilder.plugins.python.install_dependencies_plugin).execute_command(
                PIP_EXEC_STANZA + ["install", '-r', 'requirements-dev.txt'], any_value(), shell=False)
开发者ID:RonaldChristopher,项目名称:pybuilder,代码行数:29,代码来源:install_dependencies_plugin_tests.py

示例2: InstallBuildDependenciesTest

# 需要导入模块: from pybuilder.core import Project [as 别名]
# 或者: from pybuilder.core.Project import build_depends_on_requirements [as 别名]
class InstallBuildDependenciesTest(unittest.TestCase):
    def setUp(self):
        self.project = Project("unittest", ".")
        self.project.set_property("dir_install_logs", "any_directory")
        self.logger = mock(Logger)
        when(pybuilder.plugins.python.install_dependencies_plugin).execute_command(
            any_value(), any_value(), shell=True
        ).thenReturn(0)

    def tearDown(self):
        unstub()

    def test_should_install_multiple_dependencies(self):
        self.project.build_depends_on("spam")
        self.project.build_depends_on("eggs")
        self.project.build_depends_on_requirements("requirements-dev.txt")

        install_build_dependencies(self.logger, self.project)

        verify(pybuilder.plugins.python.install_dependencies_plugin).execute_command(
            "pip install 'spam'", any_value(), shell=True
        )
        verify(pybuilder.plugins.python.install_dependencies_plugin).execute_command(
            "pip install 'eggs'", any_value(), shell=True
        )
        verify(pybuilder.plugins.python.install_dependencies_plugin).execute_command(
            "pip install '-rrequirements-dev.txt'", any_value(), shell=True
        )
开发者ID:krishmatreja,项目名称:pybuilder,代码行数:30,代码来源:install_dependencies_plugin_tests.py

示例3: InstallBuildDependenciesTest

# 需要导入模块: from pybuilder.core import Project [as 别名]
# 或者: from pybuilder.core.Project import build_depends_on_requirements [as 别名]
    class InstallBuildDependenciesTest(unittest.TestCase):
        def setUp(self):
            self.project = Project("unittest", ".")
            self.project.set_property("dir_install_logs", "any_directory")
            self.logger = Mock(Logger)
            initialize_install_dependencies_plugin(self.project)

        @patch("pybuilder.plugins.python.install_dependencies_plugin.execute_command", return_value=0)
        def test_should_install_multiple_dependencies(self, exec_command, get_package_version):
            self.project.build_depends_on("spam")
            self.project.build_depends_on("eggs")
            self.project.build_depends_on_requirements("requirements-dev.txt")

            install_build_dependencies(self.logger, self.project)

            exec_command(PIP_EXEC_STANZA + ["install", "spam"], ANY, shell=False)
            exec_command(PIP_EXEC_STANZA + ["install", "eggs"], ANY, shell=False)
            exec_command(PIP_EXEC_STANZA + ["install", '-r', 'requirements-dev.txt'], ANY, shell=False)
开发者ID:wenlien,项目名称:pybuilder,代码行数:20,代码来源:install_dependencies_plugin_tests.py


注:本文中的pybuilder.core.Project.build_depends_on_requirements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。