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


Python EggInst.remove方法代码示例

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


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

示例1: test_old_appinst

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import remove [as 别名]
    def test_old_appinst(self):
        """
        Test that we still work with old (<= 2.1.1) appinst, where
        [un]install_from_dat only takes one argument (no prefix).
        """
        egg_path = DUMMY_EGG_WITH_APPINST
        appinst_path = os.path.join(self.meta_dir, "dummy_with_appinst", eggmeta.APPINST_PATH)

        egginst = EggInst(egg_path, self.base_dir)

        def mocked_old_install_from_dat(x):
            pass

        def mocked_old_uninstall_from_dat(x):
            pass

        # XXX: we use autospec to enforce function taking exactly one argument,
        # otherwise the proper TypeError exception is not raised when calling
        # it with two arguments, which is how old vs new appinst is detected.
        with mock.patch("appinst.install_from_dat", autospec=mocked_old_install_from_dat) as m:
            egginst.install()
            m.assert_called_with(appinst_path)

        with mock.patch("appinst.uninstall_from_dat", autospec=mocked_old_uninstall_from_dat) as m:
            egginst.remove()
            m.assert_called_with(appinst_path)
开发者ID:JoelB,项目名称:enstaller,代码行数:28,代码来源:test_egginst.py

示例2: test_simple_custom_egg_remove

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import remove [as 别名]
    def test_simple_custom_egg_remove(self):
        egg = DUMMY_EGG

        with assert_same_fs(self, self.base_dir):
            egginst = EggInst(egg, self.base_dir)
            egginst.install()
            egginst.remove()
开发者ID:JoelB,项目名称:enstaller,代码行数:9,代码来源:test_egginst.py

示例3: test_custom_egg_with_usr_files_remove

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import remove [as 别名]
    def test_custom_egg_with_usr_files_remove(self):
        egg = NOSE_1_3_0

        with assert_same_fs(self, self.base_dir):
            egginst = EggInst(egg, self.base_dir)
            egginst.install()
            egginst.remove()
开发者ID:JoelB,项目名称:enstaller,代码行数:9,代码来源:test_egginst.py

示例4: test_custom_egg_legacy_egg_info_remove

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import remove [as 别名]
    def test_custom_egg_legacy_egg_info_remove(self):
        egg = LEGACY_EGG_INFO_EGG

        with assert_same_fs(self, self.base_dir):
            egginst = EggInst(egg, self.base_dir)
            egginst.install()
            egginst.remove()
开发者ID:JoelB,项目名称:enstaller,代码行数:9,代码来源:test_egginst.py

示例5: test_simple

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import remove [as 别名]
    def test_simple(self):
        egginst = EggInst(DUMMY_EGG, self.base_dir)

        egginst.install()
        self.assertTrue(os.path.exists(os.path.join(self.site_packages, "dummy.py")))

        egginst.remove()
        self.assertFalse(os.path.exists(os.path.join(self.site_packages, "dummy.py")))
开发者ID:JoelB,项目名称:enstaller,代码行数:10,代码来源:test_egginst.py

示例6: test_standard_egg_remove

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import remove [as 别名]
    def test_standard_egg_remove(self):
        egg = STANDARD_EGG

        with assert_same_fs(self, self.base_dir):
            egginst = EggInst(egg, self.base_dir)
            egginst.install()

            egginst.remove()
开发者ID:JoelB,项目名称:enstaller,代码行数:10,代码来源:test_egginst.py

示例7: test_custom_egg_legacy_egg_info_remove

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import remove [as 别名]
    def test_custom_egg_legacy_egg_info_remove(self):
        custom_egg_info_base = os.path.join(self.base_dir, "EGG-INFO", "flake9")
        egg_info_base = os.path.join(self.site_packages,
                                     "flake8-2.0.0-2.egg-info")
        legacy_egg_info_base = os.path.join(self.site_packages, "flake8.egg-info")
        egg = LEGACY_EGG_INFO_EGG

        with assert_same_fs(self, self.base_dir):
            egginst = EggInst(egg, self.base_dir)
            egginst.install()
            egginst.remove()
开发者ID:dmsurti,项目名称:enstaller,代码行数:13,代码来源:test_egginst.py

示例8: test_custom_egg_with_usr_files_remove

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import remove [as 别名]
    def test_custom_egg_with_usr_files_remove(self):
        custom_egg_info_base = os.path.join(self.base_dir, "EGG-INFO", "nose")
        egg_info_base = os.path.join(self.site_packages,
                                     "nose-{0}.egg-info". \
                                     format("1.3.0-1"))
        egg = NOSE_1_3_0

        with assert_same_fs(self, self.base_dir):
            egginst = EggInst(egg, self.base_dir)
            egginst.install()
            egginst.remove()
开发者ID:dmsurti,项目名称:enstaller,代码行数:13,代码来源:test_egginst.py

示例9: test_simple_custom_egg_remove

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import remove [as 别名]
    def test_simple_custom_egg_remove(self):
        custom_egg_info_base = os.path.join(self.base_dir, "EGG-INFO", "dummy")
        egg_info_base = os.path.join(self.site_packages,
                                     "dummy-{0}.egg-info". \
                                     format("1.0.1-1"))
        egg = DUMMY_EGG

        with assert_same_fs(self, self.base_dir):
            egginst = EggInst(egg, self.base_dir)
            egginst.install()
            egginst.remove()
开发者ID:dmsurti,项目名称:enstaller,代码行数:13,代码来源:test_egginst.py

示例10: test_standard_egg_remove

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import remove [as 别名]
    def test_standard_egg_remove(self):
        custom_egg_info_base = os.path.join(self.base_dir, "EGG-INFO", "jinja2")
        egg_info_base = os.path.join(self.site_packages,
                                     "Jinja2-2.6-py2.7.egg-info")
        egg = STANDARD_EGG

        with assert_same_fs(self, self.base_dir):
            egginst = EggInst(egg, self.base_dir)
            egginst.install()

            egginst.remove()
开发者ID:dmsurti,项目名称:enstaller,代码行数:13,代码来源:test_egginst.py

示例11: test_without_appinst

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import remove [as 别名]
    def test_without_appinst(self):
        """
        Test egginst does not crash when appinst is not available and we try
        installing eggs using appinst
        """
        egg_path = DUMMY_EGG_WITH_APPINST

        egginst = EggInst(egg_path, self.base_dir)

        with mock.patch("egginst.main.appinst", None):
            egginst.install()
            egginst.remove()
开发者ID:JoelB,项目名称:enstaller,代码行数:14,代码来源:test_egginst.py

示例12: test_entry_points

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import remove [as 别名]
    def test_entry_points(self):
        """
        Test we install console entry points correctly.
        """
        egginst = EggInst(DUMMY_EGG_WITH_ENTRY_POINTS, self.base_dir)

        egginst.install()
        self.assertTrue(op.exists(op.join(self.site_packages, "dummy.py")))
        self.assertTrue(op.exists(op.join(self.bindir, "dummy")))

        egginst.remove()
        self.assertFalse(op.exists(op.join(self.site_packages, "dummy.py")))
        self.assertFalse(op.exists(op.join(self.bindir, "dummy")))
开发者ID:cournape,项目名称:enstaller,代码行数:15,代码来源:test_egginst.py

示例13: test_simple_

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import remove [as 别名]
    def test_simple_(self):
        # Given
        remover = EggInst(DUMMY_EGG, self.prefix)

        # When
        with testfixtures.LogCapture() as logger:
            remover.remove()

        # Then
        logger.check(
            ('egginst.main', 'ERROR',
             "Error: Can't find meta data for: 'dummy'")
        )
开发者ID:JoelB,项目名称:enstaller,代码行数:15,代码来源:test_egginst.py

示例14: test_appinst_failed

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import remove [as 别名]
    def test_appinst_failed(self):
        """
        Test egginst does not crash when appinst is not available and we try
        installing eggs using appinst
        """
        egg_path = DUMMY_EGG_WITH_APPINST

        egginst = EggInst(egg_path, self.base_dir)

        with mock.patch("egginst.main.appinst.install_from_dat", side_effect=ValueError):
            egginst.install()

        with mock.patch("egginst.main.appinst.uninstall_from_dat", side_effect=ValueError):
            egginst.remove()
开发者ID:JoelB,项目名称:enstaller,代码行数:16,代码来源:test_egginst.py

示例15: test_pre_egguninst

# 需要导入模块: from egginst.main import EggInst [as 别名]
# 或者: from egginst.main.EggInst import remove [as 别名]
    def test_pre_egguninst(self):
        # Given
        create_venv(self.prefix)

        remover = EggInst(DUMMY_EGG_WITH_PRE_REMOVE, self.prefix)
        remover.install()

        # When
        remover.remove()

        # Then
        # Ensure text file created by pre-remove script exists
        self.assertTrue(
            os.path.exists(os.path.join(self.prefix, "touch.txt"))
        )
开发者ID:enthought,项目名称:enstaller,代码行数:17,代码来源:test_egginst.py


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