Exemplo n.º 1
0
    def test_positive_update_name(self):
        """Successfully update an Architecture.

        @Feature: Architecture

        @Assert: Architecture is updated.
        """
        architecture = make_architecture()
        for new_name in valid_data_list():
            with self.subTest(new_name):
                Architecture.update({
                    'id': architecture['id'],
                    'new-name': new_name,
                })
                architecture = Architecture.info({'id': architecture['id']})
                self.assertEqual(architecture['name'], new_name)
Exemplo n.º 2
0
    def test_positive_update_name(self):
        """Successfully update an Architecture.

        @id: 67f1e60b-29e2-44a4-8019-498e5ad0e201

        @Assert: Architecture is updated.
        """
        architecture = make_architecture()
        for new_name in valid_data_list():
            with self.subTest(new_name):
                Architecture.update({
                    'id': architecture['id'],
                    'new-name': new_name,
                })
                architecture = Architecture.info({'id': architecture['id']})
                self.assertEqual(architecture['name'], new_name)
Exemplo n.º 3
0
    def test_positive_update_name(self):
        """Successfully update an Architecture.

        @Feature: Architecture

        @Assert: Architecture is updated.
        """
        architecture = make_architecture()
        for new_name in valid_data_list():
            with self.subTest(new_name):
                Architecture.update({
                    'id': architecture['id'],
                    'new-name': new_name,
                })
                architecture = Architecture.info({'id': architecture['id']})
                self.assertEqual(architecture['name'], new_name)
Exemplo n.º 4
0
    def test_positive_update_name(self):
        """Successfully update an Architecture.

        @id: 67f1e60b-29e2-44a4-8019-498e5ad0e201

        @Assert: Architecture is updated.
        """
        architecture = make_architecture()
        for new_name in valid_data_list():
            with self.subTest(new_name):
                Architecture.update({
                    'id': architecture['id'],
                    'new-name': new_name,
                })
                architecture = Architecture.info({'id': architecture['id']})
                self.assertEqual(architecture['name'], new_name)
Exemplo n.º 5
0
    def test_negative_update_name(self):
        """Create Architecture then fail to update its name

        @feature: Architecture

        @assert: Architecture name is not updated
        """
        architecture = make_architecture()
        for new_name in invalid_values_list():
            with self.subTest(new_name):
                with self.assertRaises(CLIReturnCodeError):
                    Architecture.update({
                        'id': architecture['id'],
                        'new-name': new_name,
                    })
                result = Architecture.info({'id': architecture['id']})
                self.assertEqual(architecture['name'], result['name'])
Exemplo n.º 6
0
    def test_negative_update_name(self):
        """Create Architecture then fail to update its name

        @feature: Architecture

        @assert: Architecture name is not updated
        """
        architecture = make_architecture()
        for new_name in invalid_values_list():
            with self.subTest(new_name):
                with self.assertRaises(CLIReturnCodeError):
                    Architecture.update({
                        'id': architecture['id'],
                        'new-name': new_name,
                    })
                result = Architecture.info({'id': architecture['id']})
                self.assertEqual(architecture['name'], result['name'])
Exemplo n.º 7
0
    def test_positive_update_name(self):
        """Successfully update an Architecture.

        :id: 67f1e60b-29e2-44a4-8019-498e5ad0e201

        :expectedresults: Architecture is updated.

        :CaseImportance: Critical
        """
        architecture = make_architecture()
        for new_name in valid_data_list().values():
            with self.subTest(new_name):
                Architecture.update({
                    'id': architecture['id'],
                    'new-name': new_name
                })
                architecture = Architecture.info({'id': architecture['id']})
                self.assertEqual(architecture['name'], new_name)
Exemplo n.º 8
0
    def test_negative_update_name(self):
        """Create Architecture then fail to update its name

        @id: 037c4892-5e62-46dd-a2ed-92243e870e40

        @assert: Architecture name is not updated
        """
        architecture = make_architecture()
        for new_name in invalid_values_list():
            with self.subTest(new_name):
                with self.assertRaises(CLIReturnCodeError) as raise_ctx:
                    Architecture.update({
                        'id': architecture['id'],
                        'new-name': new_name,
                    })
                self.assert_error_msg(raise_ctx,
                                      u'Could not update the architecture:')
                result = Architecture.info({'id': architecture['id']})
                self.assertEqual(architecture['name'], result['name'])
Exemplo n.º 9
0
    def test_negative_update_name(self, class_architecture, new_name):
        """Create Architecture then fail to update its name

        :id: 037c4892-5e62-46dd-a2ed-92243e870e40

        :parametrized: yes

        :expectedresults: Architecture name is not updated

        :CaseImportance: Medium
        """

        with pytest.raises(CLIReturnCodeError) as error:
            Architecture.update({'id': class_architecture['id'], 'new-name': new_name})

        assert 'Could not update the architecture:' in error.value.message

        result = Architecture.info({'id': class_architecture['id']})
        assert class_architecture['name'] == result['name']
Exemplo n.º 10
0
    def test_negative_update_name(self):
        """Create Architecture then fail to update its name

        @id: 037c4892-5e62-46dd-a2ed-92243e870e40

        @assert: Architecture name is not updated
        """
        architecture = make_architecture()
        for new_name in invalid_values_list():
            with self.subTest(new_name):
                with self.assertRaises(CLIReturnCodeError) as raise_ctx:
                    Architecture.update({
                        'id': architecture['id'],
                        'new-name': new_name,
                    })
                self.assert_error_msg(raise_ctx,
                                      u'Could not update the architecture:')
                result = Architecture.info({'id': architecture['id']})
                self.assertEqual(architecture['name'], result['name'])
Exemplo n.º 11
0
    def test_positive_CRUD(self):
        """Create a new Architecture, update the name and delete the Architecture itself.

        :id: cd8654b8-e603-11ea-adc1-0242ac120002

        :expectedresults: Architecture is created, modified and deleted successfully

        :CaseImportance: Critical
        """

        name = gen_choice(list(valid_data_list().values()))
        new_name = gen_choice(list(valid_data_list().values()))

        architecture = make_architecture({'name': name})
        assert architecture['name'] == name
        Architecture.update({'id': architecture['id'], 'new-name': new_name})
        architecture = Architecture.info({'id': architecture['id']})
        assert architecture['name'] == new_name
        Architecture.delete({'id': architecture['id']})
        with pytest.raises(CLIReturnCodeError):
            Architecture.info({'id': architecture['id']})
Exemplo n.º 12
0
    def test_negative_update(self, data):
        """@test: Create architecture then fail to update
        its name

        @feature: Architecture

        @assert: architecture name is not updated

        """
        try:
            new_obj = make_architecture()
        except CLIFactoryError as err:
            self.fail(err)

        # Update the architecture name
        result = Architecture.update({
            'id': new_obj['id'],
            'new-name': data,
        })
        self.assertNotEqual(result.return_code, 0)
        self.assertGreater(len(result.stderr), 0)
Exemplo n.º 13
0
    def test_negative_update(self, data):
        """@test: Create architecture then fail to update
        its name

        @feature: Architecture

        @assert: architecture name is not updated

        """
        try:
            new_obj = make_architecture()
        except CLIFactoryError as err:
            self.fail(err)

        # Update the architecture name
        result = Architecture.update({
            'id': new_obj['id'],
            'new-name': data,
        })
        self.assertNotEqual(result.return_code, 0)
        self.assertGreater(len(result.stderr), 0)