def test_10__init_by_preset_defaults(self): cfg = TT._init_by_preset_defaults() self.assertTrue(isinstance(cfg, dict)) # This check is far from perfect but... for k in _CONF_KEYS: self.assertTrue(k in cfg) self.assertTrue(isinstance(cfg["repo_params"], list))
def test_10_mk_repos(self): ctx = MC._init_by_preset_defaults() repos = list(TT.mk_repos(ctx)) ctx2 = ctx.copy() ctx2["dists"] = "fedora-19-x86_64,fedora-19-i386" expected = [ MR.Repo( "fedora", "19", ["x86_64", "i386"], TT.mk_repo_server(ctx2), ctx2["reponame"], selfref=ctx2["selfref"] ) ] self.assertTrue(repos) self.assertEquals(len(repos), len(expected)) f = pprint.pformat for r, e in itertools.izip_longest(repos, expected): self.assertEquals(r, e, C.diff(f(r), f(e)))