Exemplo n.º 1
0
    def test_update_baymodel_name_not_found(self):
        path = "/name"
        patch_model = datagen.baymodel_replace_patch_data(path)

        self.assertRaises(
            exceptions.NotFound,
            self.baymodel_client.patch_baymodel, 'fooo', patch_model)
Exemplo n.º 2
0
    def test_update_baymodel_name_not_found(self):
        path = "/name"
        patch_model = datagen.baymodel_replace_patch_data(path)

        self.assertRaises(
            exceptions.NotFound,
            self.baymodel_client.patch_baymodel, 'fooo', patch_model)
Exemplo n.º 3
0
    def test_update_baymodel_404(self):
        path = "/name"
        patch_model = datagen.baymodel_replace_patch_data(path)

        self.assertRaises(exceptions.NotFound,
                          self.baymodel_client.patch_baymodel,
                          data_utils.rand_uuid(), patch_model)
Exemplo n.º 4
0
    def test_update_baymodel_404(self):
        path = "/name"
        patch_model = datagen.baymodel_replace_patch_data(path)

        self.assertRaises(
            exceptions.NotFound,
            self.baymodel_client.patch_baymodel,
            data_utils.rand_uuid(), patch_model)
Exemplo n.º 5
0
    def test_update_baymodel_public_by_uuid(self):
        path = "/public"
        gen_model = datagen.baymodel_data_with_valid_keypair_image_flavor()
        resp, old_model = self._create_baymodel(gen_model)

        patch_model = datagen.baymodel_replace_patch_data(path, value=True)
        self.assertRaises(
            exceptions.Forbidden,
            self.baymodel_client.patch_baymodel, old_model.uuid, patch_model)
Exemplo n.º 6
0
    def test_update_baymodel_public_by_uuid(self):
        path = "/public"
        gen_model = datagen.baymodel_data_with_valid_keypair_image_flavor()
        resp, old_model = self._create_baymodel(gen_model)

        patch_model = datagen.baymodel_replace_patch_data(path, value=True)
        resp, new_model = self.baymodel_client.patch_baymodel(
            old_model.uuid, patch_model)
        self.assertEqual(200, resp.status)

        resp, model = self.baymodel_client.get_baymodel(new_model.uuid)
        self.assertEqual(200, resp.status)
        self.assertTrue(model.public)
Exemplo n.º 7
0
    def test_update_baymodel_public_by_uuid(self):
        path = "/public"
        gen_model = datagen.baymodel_data_with_valid_keypair_image_flavor()
        resp, old_model = self._create_baymodel(gen_model)

        patch_model = datagen.baymodel_replace_patch_data(path, value=True)
        resp, new_model = self.baymodel_client.patch_baymodel(
            old_model.uuid, patch_model)
        self.assertEqual(200, resp.status)

        resp, model = self.baymodel_client.get_baymodel(new_model.uuid)
        self.assertEqual(200, resp.status)
        self.assertTrue(model.public)
Exemplo n.º 8
0
    def test_update_baymodel_by_uuid(self):
        gen_model = datagen.baymodel_data_with_valid_keypair_image_flavor()
        resp, old_model = self._create_baymodel(gen_model)

        path = "/name"
        patch_model = datagen.baymodel_replace_patch_data(path)
        resp, new_model = self.baymodel_client.patch_baymodel(
            old_model.uuid, patch_model)
        self.assertEqual(200, resp.status)

        resp, model = self.baymodel_client.get_baymodel(new_model.uuid)
        self.assertEqual(200, resp.status)
        self.assertEqual(old_model.uuid, new_model.uuid)
        self.assertEqual(model.name, new_model.name)
Exemplo n.º 9
0
    def test_update_baymodel_by_uuid(self):
        gen_model = datagen.baymodel_data_with_valid_keypair_image_flavor()
        resp, old_model = self._create_baymodel(gen_model)

        path = "/name"
        patch_model = datagen.baymodel_replace_patch_data(path)
        resp, new_model = self.baymodel_client.patch_baymodel(
            old_model.uuid, patch_model)
        self.assertEqual(200, resp.status)

        resp, model = self.baymodel_client.get_baymodel(new_model.uuid)
        self.assertEqual(200, resp.status)
        self.assertEqual(old_model.uuid, new_model.uuid)
        self.assertEqual(model.name, new_model.name)