Пример #1
0
    def test_verification_list(self):
        deploy = db.deployment_create({})
        v1 = db.verification_create(
            self.verifier["uuid"], deploy["uuid"], ["foo", "bar"], {})
        v2 = self._create_verification()

        vs = db.verification_list(self.verifier["uuid"])
        self.assertEqual(sorted([v1["uuid"], v2["uuid"]]),
                         sorted([v["uuid"] for v in vs]))

        vs = db.verification_list(self.verifier["uuid"], deploy["uuid"])
        self.assertEqual(1, len(vs))
        self.assertEqual(v1["uuid"], vs[0]["uuid"])

        vs = db.verification_list(tags=["bar"])
        self.assertEqual(1, len(vs))
        self.assertEqual(v1["uuid"], vs[0]["uuid"])

        v2 = db.verification_update(v2["uuid"], status="foo")
        vs = db.verification_list(status="foo")
        self.assertEqual(1, len(vs))
        self.assertEqual(v2["uuid"], vs[0]["uuid"])
Пример #2
0
    def test_verification_list(self):
        deploy = db.deployment_create({})
        v1 = db.verification_create(self.verifier["uuid"], deploy["uuid"],
                                    ["foo", "bar"], {})
        v2 = self._create_verification()

        vs = db.verification_list(self.verifier["uuid"])
        self.assertEqual(sorted([v1["uuid"], v2["uuid"]]),
                         sorted([v["uuid"] for v in vs]))

        vs = db.verification_list(self.verifier["uuid"], deploy["uuid"])
        self.assertEqual(1, len(vs))
        self.assertEqual(v1["uuid"], vs[0]["uuid"])

        vs = db.verification_list(tags=["bar"])
        self.assertEqual(1, len(vs))
        self.assertEqual(v1["uuid"], vs[0]["uuid"])

        v2 = db.verification_update(v2["uuid"], status="foo")
        vs = db.verification_list(status="foo")
        self.assertEqual(1, len(vs))
        self.assertEqual(v2["uuid"], vs[0]["uuid"])
Пример #3
0
 def _create_verification(self):
     deployment_uuid = self.deploy["uuid"]
     return db.verification_create(deployment_uuid)
Пример #4
0
 def __init__(self, db_object=None, deployment_uuid=None):
     if db_object:
         self.db_object = db_object
     else:
         self.db_object = db.verification_create(deployment_uuid)
Пример #5
0
 def _create_verification(self):
     verifier_uuid = self.verifier["uuid"]
     deployment_uuid = self.deploy["uuid"]
     return db.verification_create(verifier_uuid, deployment_uuid, [], {})
Пример #6
0
 def create(cls, verifier_id, deployment_id, tags=None, run_args=None):
     return cls(
         db.verification_create(verifier_id, deployment_id, tags, run_args))
Пример #7
0
 def _create_verification(self, tags=None, env_uuid=None):
     tags = tags or []
     verifier_uuid = self.verifier["uuid"]
     env_uuid = env_uuid or self.env["uuid"]
     return db.verification_create(verifier_uuid, env_uuid, tags, {})
Пример #8
0
 def _create_verification(self):
     deployment_uuid = self.deploy["uuid"]
     return db.verification_create(deployment_uuid)
Пример #9
0
 def _create_verification(self, tags=None, env_uuid=None):
     tags = tags or []
     verifier_uuid = self.verifier["uuid"]
     env_uuid = env_uuid or self.env["uuid"]
     return db.verification_create(verifier_uuid, env_uuid, tags, {})
Пример #10
0
 def _create_verification(self):
     verifier_uuid = self.verifier["uuid"]
     deployment_uuid = self.deploy["uuid"]
     return db.verification_create(verifier_uuid, deployment_uuid, [], {})
Пример #11
0
 def create(cls, verifier_id, deployment_id, tags=None, run_args=None):
     return cls(db.verification_create(
         verifier_id, deployment_id, tags, run_args))