コード例 #1
0
ファイル: test_patchqueue.py プロジェクト: psafont/planex
 def test_autosetup_disabled(self):
     """Patchqueue application fails if %autosetup is not present"""
     spec = Spec("tests/data/ocaml-uri.spec", check_package_name=False)
     spec.add_patch(0, Blob(spec, "first.patch", "dummy"))
     spec.disable_autosetup()
     rewritten = spec.rewrite_spec()
     self.assertIn("Patch0: first.patch\n", rewritten)
コード例 #2
0
ファイル: test_patchqueue.py プロジェクト: psafont/planex
 def test_autosetup_present(self):
     """Patchqueue application succeeds if %autosetup is present"""
     spec = Spec("tests/data/branding-xenserver.spec",
                 check_package_name=False)
     spec.add_patch(0, Blob(spec, "first.patch", "dummy"))
     rewritten = spec.rewrite_spec()
     self.assertIn("Patch0: first.patch\n", rewritten)
コード例 #3
0
ファイル: test_patchqueue.py プロジェクト: srowe/planex
 def test_autosetup_disabled(self):
     """Patchqueue application fails if %autosetup is not present"""
     spec = Spec("tests/data/ocaml-uri.spec", check_package_name=False)
     spec.add_patch(0, Blob(spec, "first.patch", "dummy"))
     spec.disable_autosetup()
     rewritten = spec.rewrite_spec()
     self.assertIn("Patch0: first.patch\n", rewritten)
コード例 #4
0
ファイル: test_patchqueue.py プロジェクト: srowe/planex
 def test_autosetup_present(self):
     """Patchqueue application succeeds if %autosetup is present"""
     spec = Spec("tests/data/branding-xenserver.spec",
                 check_package_name=False)
     spec.add_patch(0, Blob(spec, "first.patch", "dummy"))
     rewritten = spec.rewrite_spec()
     self.assertIn("Patch0: first.patch\n", rewritten)
コード例 #5
0
ファイル: test_patchqueue.py プロジェクト: psafont/planex
    def test_overridden_patch_in_spec(self):
        """Patches with the same index override each other"""
        spec = Spec("tests/data/branding-xenserver.spec",
                    check_package_name=False)
        spec.add_patch(0, Blob(spec, "first.patch", "dummy"))
        spec.add_patch(1, Blob(spec, "second.patch", "dummy"))
        spec.add_patch(0, Blob(spec, "third.patch", "dummy"))

        rewritten = spec.rewrite_spec()
        self.assertNotIn("Patch0: first.patch\n", rewritten)
        self.assertIn("Patch1: second.patch\n", rewritten)
        self.assertIn("Patch0: third.patch\n", rewritten)
コード例 #6
0
ファイル: test_patchqueue.py プロジェクト: psafont/planex
    def test_rewrite_spec(self):
        """Patches are inserted into rewritten spec file"""
        spec = Spec("tests/data/branding-xenserver.spec",
                    check_package_name=False)
        spec.add_patch(0, Blob(spec, "first.patch", "dummy"))
        spec.add_patch(1, Blob(spec, "second.patch", "dummy"))
        spec.add_patch(2, Blob(spec, "third.patch", "dummy"))

        rewritten = spec.rewrite_spec()
        self.assertIn("Patch0: first.patch\n", rewritten)
        self.assertIn("Patch1: second.patch\n", rewritten)
        self.assertIn("Patch2: third.patch\n", rewritten)
コード例 #7
0
ファイル: test_patchqueue.py プロジェクト: srowe/planex
    def test_overridden_patch_in_spec(self):
        """Patches with the same index override each other"""
        spec = Spec("tests/data/branding-xenserver.spec",
                    check_package_name=False)
        spec.add_patch(0, Blob(spec, "first.patch", "dummy"))
        spec.add_patch(1, Blob(spec, "second.patch", "dummy"))
        spec.add_patch(0, Blob(spec, "third.patch", "dummy"))

        rewritten = spec.rewrite_spec()
        self.assertNotIn("Patch0: first.patch\n", rewritten)
        self.assertIn("Patch1: second.patch\n", rewritten)
        self.assertIn("Patch0: third.patch\n", rewritten)
コード例 #8
0
ファイル: test_patchqueue.py プロジェクト: srowe/planex
    def test_rewrite_spec(self):
        """Patches are inserted into rewritten spec file"""
        spec = Spec("tests/data/branding-xenserver.spec",
                    check_package_name=False)
        spec.add_patch(0, Blob(spec, "first.patch", "dummy"))
        spec.add_patch(1, Blob(spec, "second.patch", "dummy"))
        spec.add_patch(2, Blob(spec, "third.patch", "dummy"))

        rewritten = spec.rewrite_spec()
        self.assertIn("Patch0: first.patch\n", rewritten)
        self.assertIn("Patch1: second.patch\n", rewritten)
        self.assertIn("Patch2: third.patch\n", rewritten)
コード例 #9
0
ファイル: test_patchqueue.py プロジェクト: psafont/planex
 def test_autosetup_missing(self):
     """Patchqueue application fails if %autosetup is not present"""
     spec = Spec("tests/data/ocaml-uri.spec", check_package_name=False)
     spec.add_patch(0, Blob(spec, "first.patch", "dummy"))
     with self.assertRaises(planex.patchqueue.SpecMissingAutosetup):
         spec.rewrite_spec()
コード例 #10
0
ファイル: test_patchqueue.py プロジェクト: srowe/planex
 def test_autosetup_missing(self):
     """Patchqueue application fails if %autosetup is not present"""
     spec = Spec("tests/data/ocaml-uri.spec", check_package_name=False)
     spec.add_patch(0, Blob(spec, "first.patch", "dummy"))
     with self.assertRaises(planex.patchqueue.SpecMissingAutosetup):
         spec.rewrite_spec()