Beispiel #1
0
def get_backend_obj(workdir, listfile, step="build", format="tgz"):
    tmplpath = os.path.join(TOPDIR, "templates")

    btype = "buildrpm.%s" % format

    args = "-n foo -w %s --template-path %s -v" % (workdir, tmplpath)
    args += " --driver %s --stepto %s %s" % (btype, step, listfile)

    pkgdata = TC.init_pkgdata(args)

    bcls = Registry.map().get(btype)
    backend = bcls(pkgdata)

    return backend
Beispiel #2
0
    def test__package_spec(self):
        filelist = os.path.join(
            selfdir(), "config_example_01.json"
        )
        args = "-n foo -C " + filelist
        pkgdata = BTC.init_pkgdata(args)

        # TODO:
        pkgdata.relations = []
        context = pkgdata

        tmpl = tmplpath("package.spec")

        c = TW.template_compile(tmpl, context)
        self.assertNotEquals(c, "")