Example #1
0
 def GetSavedOverrides(self):
     if not self.StatsExist():
         raise PackageError("Package stats not ready.")
     pkg_stats = self.GetDbObject()
     res = m.CheckpkgOverride.select(
         m.CheckpkgOverride.q.srv4_file == pkg_stats)
     override_list = []
     for db_override in res:
         d = {
             'pkgname': db_override.pkgname,
             'tag_name': db_override.tag_name,
             'tag_info': db_override.tag_info,
         }
         override_list.append(overrides.Override(**d))
     return override_list
Example #2
0
 def test_5(self):
     tags = [tag.CheckpkgTag("CSWfoo", "foo-tag", "tag-info-1")]
     oo = [overrides.Override("CSWfoo", "foo-tag", "tag-info-1")]
     self.assertEqual(([], set([])), overrides.ApplyOverrides(tags, oo))
Example #3
0
 def test_2(self):
     """One override, matching by tag name and tag info, no pkgname."""
     tags = [tag.CheckpkgTag("CSWfoo", "foo-tag")]
     oo = [overrides.Override(None, "foo-tag", None)]
     self.assertEqual(([], set([])), overrides.ApplyOverrides(tags, oo))
Example #4
0
 def test_3(self):
     """One override, matching by tag name, mismatching tag info, no pkgname."""
     tags = [tag.CheckpkgTag("CSWfoo", "foo-tag", "tag-info-1")]
     oo = [overrides.Override(None, "foo-tag", "tag-info-2")]
     self.assertEqual((tags, set(oo)), overrides.ApplyOverrides(tags, oo))
Example #5
0
 def test_6(self):
     """Pkgname mismatch."""
     tags = [tag.CheckpkgTag("CSWfoo", "foo-tag", "tag-info-1")]
     oo = [overrides.Override("CSWbar", "foo-tag", "tag-info-1")]
     self.assertEqual((tags, set(oo)), overrides.ApplyOverrides(tags, oo))