예제 #1
0
    def test_020_gen_repo_file_content(self):
        ctx = mk_ctx()
        ctx.update(ctx["repos"][0].as_dict())

        ref = C.readfile("result.repo.0", _CURDIR)
        s = TT.gen_repo_file_content(ctx, C.template_paths())

        self.assertEquals(s, ref, C.diff(s, ref))
예제 #2
0
    def test_022_gen_repo_file_content__w_keyid_and_repo_params(self):
        ctx = mk_ctx()
        ctx.update(ctx["repos"][0].as_dict())

        # Override it:
        ctx["keyid"] = "dummykey001"
        ctx["repo_params"] = ["failovermethod=priority", "metadata_expire=7d"]

        ref = C.readfile("result.repo.1", _CURDIR)
        s = TT.gen_repo_file_content(ctx, C.template_paths())

        self.assertEquals(s, ref, C.diff(s, ref))