Esempio n. 1
0
    def test_simple(self):
        # When/Then
        with assert_same_fs(self, self.scratch):
            path = os.path.join(self.scratch, "yo")
            with open(path, "w") as fp:
                fp.write("")
            os.unlink(path)

        # When/Then
        with self.assertRaises(AssertionError):
            with assert_same_fs(self, self.scratch):
                path = os.path.join(self.scratch, "yo")
                with open(path, "w") as fp:
                    fp.write("")
Esempio n. 2
0
    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()
Esempio n. 3
0
    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()
Esempio n. 4
0
    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()
Esempio n. 5
0
    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()
Esempio n. 6
0
    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()
Esempio n. 7
0
    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()
Esempio n. 8
0
    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()
Esempio n. 9
0
    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()
Esempio n. 10
0
    def test_remove_file(self):
        # Given
        path = os.path.join(self.scratch, "yo")
        with open(path, "w") as fp:
            fp.write("")

        # When/Then
        with assert_same_fs(self, self.scratch):
            self.assertTrue(os.path.exists(path))
Esempio n. 11
0
    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()
Esempio n. 12
0
    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()
Esempio n. 13
0
    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()
Esempio n. 14
0
    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()
Esempio n. 15
0
 def test_empty(self):
     # When/Then
     with assert_same_fs(self, self.scratch):
         pass