예제 #1
0
파일: test_api.py 프로젝트: fetahi/rally
    def test_env_update(self):
        env = db.env_create("name", "status", "descr", {}, {}, {}, [])
        self.assertTrue(db.env_update(env["uuid"]))
        self.assertTrue(
            db.env_update(env["uuid"], "another_descr", {"e": 123}, {"c": 1}))

        env = db.env_get(env["uuid"])
        self.assertEqual("another_descr", env["description"])
        self.assertEqual({"e": 123}, env["extras"])
        self.assertEqual({"c": 1}, env["config"])
예제 #2
0
    def test_env_update(self):
        env = db.env_create("name", "status", "descr", {}, {}, {}, [])
        self.assertTrue(db.env_update(env["uuid"]))
        self.assertTrue(
            db.env_update(env["uuid"], "another_descr", {"e": 123}, {"c": 1}))

        env = db.env_get(env["uuid"])
        self.assertEqual("another_descr", env["description"])
        self.assertEqual({"e": 123}, env["extras"])
        self.assertEqual({"c": 1}, env["config"])
예제 #3
0
파일: env_mgr.py 프로젝트: noah8713/rally
    def update(self, description=None, config=None, extras=None):
        """Update description and extras for environment.

        :param description: New description for env
        :param extras: New extras for env
        """
        return db.env_update(
            self.uuid, description=description, config=config, extras=extras)
예제 #4
0
파일: env_mgr.py 프로젝트: openstack/rally
    def update(self, description=None, config=None, extras=None):
        """Update description and extras for environment.

        :param description: New description for env
        :param extras: New extras for env
        """
        return db.env_update(
            self.uuid, description=description, config=config, extras=extras)
예제 #5
0
    def update(self, description=None, extras=None):
        """Update description and extras for environment.

        :param description: New description for env
        :param extras: New extras for env
        """
        values = {}

        if description and description != self._env["description"]:
            values["description"] = description
        if extras and extras != self._env["extras"]:
            values["extras"] = extras

        if values:
            return db.env_update(self.uuid, **values)
        return True