def test_verifier_list(self): v1 = db.verifier_create("a1", "b1", "c1", "d1", "e1", False) v2 = db.verifier_create("a2", "b2", "c2", "d2", "e2", False) vs = db.verifier_list() self.assertEqual(sorted([v1["uuid"], v2["uuid"]]), sorted([v["uuid"] for v in vs])) v1 = db.verifier_update(v1["uuid"], status="foo") vs = db.verifier_list(status="foo") self.assertEqual(1, len(vs)) self.assertEqual(v1["uuid"], vs[0]["uuid"])
def create(cls, name, vtype, platform, source, version, system_wide, extra_settings=None): db_entry = db.verifier_create(name=name, vtype=vtype, platform=platform, source=source, version=version, system_wide=system_wide, extra_settings=extra_settings) return cls(db_entry)
def setUp(self): super(VerificationTestCase, self).setUp() self.verifier = db.verifier_create("a", "b", "c", "d", "e", False) self.deploy = db.deployment_create({})
def test_verification_update(self): v = db.verifier_create("a", "b", "c", "d", "e", False) v = db.verifier_update(v["uuid"], source="foo", version="bar") self.assertEqual("foo", v["source"]) self.assertEqual("bar", v["version"])
def test_verifier_delete(self): v = db.verifier_create("a", "b", "c", "d", "e", False) db.verifier_delete(v["uuid"]) self.assertRaises(exceptions.ResourceNotFound, db.verifier_delete, v["uuid"])
def test_verifier_get(self): v = db.verifier_create("a", "b", "c", "d", "e", False) self.assertEqual("a", db.verifier_get(v["uuid"])["name"])
def setUp(self): super(VerificationTestCase, self).setUp() self.verifier = db.verifier_create("a", "b", "c", "d", "e", False) self.env = db.env_create(self.id(), "INIT", "", {}, {}, {}, [])
def test_verifier_delete(self): v = db.verifier_create("a", "b", "c", "d", "e", False) db.verifier_delete(v["uuid"]) self.assertRaises(exceptions.DBRecordNotFound, db.verifier_delete, v["uuid"])