Ejemplo n.º 1
0
    def test_040_gen_rpmspec_content(self):
        repo = mk_remote_repo()
        ctx = mk_ctx([repo])

        ref = C.readfile("result.yum-repodata.spec.0", _CURDIR).strip()
        ref = ref.replace("DATESTAMP", TT._datestamp())

        s = TT.gen_rpmspec_content(repo, ctx, C.template_paths()).strip()
        self.assertEquals(s, ref, C.diff(s, ref))
Ejemplo n.º 2
0
    def test_42_gen_rpmspec_content__w_keyid(self):
        repo = mk_remote_repo()
        ctx = mk_ctx([repo])

        keyids = _find_gpg_keyids()
        if keyids:
            ctx["keyid"] = keyid = random.choice(keyids)
        else:
            sys.stderr.write("No GPG keyid was found. Skip this test...\n")
            return

        ref = C.readfile("result.yum-repodata.spec.1", _CURDIR).strip()
        ref = ref.replace("DATESTAMP", TT._datestamp())

        s = TT.gen_rpmspec_content(repo, ctx, C.template_paths()).strip()
        self.assertEquals(s, ref, C.diff(s, ref))