当前位置: 首页>>代码示例>>Python>>正文


Python partitiontable.PartitionTable类代码示例

本文整理汇总了Python中robottelo.cli.partitiontable.PartitionTable的典型用法代码示例。如果您正苦于以下问题:Python PartitionTable类的具体用法?Python PartitionTable怎么用?Python PartitionTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PartitionTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_positive_delete_by_name

    def test_positive_delete_by_name(self):
        """Create a Partition Table then delete it by its name

        @id: 27bd427c-7601-4f3b-998f-b7baaaad0fb0

        @Assert: Partition Table is deleted
        """
        ptable = make_partition_table()
        PartitionTable.delete({'name': ptable['name']})
        with self.assertRaises(CLIReturnCodeError):
            PartitionTable.info({'name': ptable['name']})
开发者ID:Ichimonji10,项目名称:robottelo,代码行数:11,代码来源:test_partitiontable.py

示例2: test_positive_delete_by_id

    def test_positive_delete_by_id(self):
        """Create a Partition Table then delete it by its ID

        @id: 4d2369eb-4dc1-4ab5-96d4-c872c39f4ff5

        @Assert: Partition Table is deleted
        """
        ptable = make_partition_table()
        PartitionTable.delete({'id': ptable['id']})
        with self.assertRaises(CLIReturnCodeError):
            PartitionTable.info({'id': ptable['id']})
开发者ID:Ichimonji10,项目名称:robottelo,代码行数:11,代码来源:test_partitiontable.py

示例3: test_positive_delete_by_name

    def test_positive_delete_by_name(self):
        """Create a Partition Table then delete it by its name

        @Feature: Partition Table

        @Assert: Partition Table is deleted
        """
        ptable = make_partition_table()
        PartitionTable.delete({'name': ptable['name']})
        with self.assertRaises(CLIReturnCodeError):
            PartitionTable.info({'name': ptable['name']})
开发者ID:anarang,项目名称:robottelo,代码行数:11,代码来源:test_partitiontable.py

示例4: test_positive_delete_by_id

    def test_positive_delete_by_id(self):
        """Create a Partition Table then delete it by its ID

        :id: 4d2369eb-4dc1-4ab5-96d4-c872c39f4ff5

        :expectedresults: Partition Table is deleted

        :CaseImportance: Critical
        """
        ptable = make_partition_table()
        PartitionTable.delete({'id': ptable['id']})
        with self.assertRaises(CLIReturnCodeError):
            PartitionTable.info({'id': ptable['id']})
开发者ID:elyezer,项目名称:robottelo,代码行数:13,代码来源:test_partitiontable.py

示例5: test_positive_delete_by_name

    def test_positive_delete_by_name(self):
        """Create a Partition Table then delete it by its name

        :id: 27bd427c-7601-4f3b-998f-b7baaaad0fb0

        :expectedresults: Partition Table is deleted

        :CaseImportance: Critical
        """
        ptable = make_partition_table()
        PartitionTable.delete({'name': ptable['name']})
        with self.assertRaises(CLIReturnCodeError):
            PartitionTable.info({'name': ptable['name']})
开发者ID:elyezer,项目名称:robottelo,代码行数:13,代码来源:test_partitiontable.py

示例6: test_add_ptable

    def test_add_ptable(self):
        """@test: Add ptable to os

        @feature: Operating System - Add ptable

        @assert: Operating System is updated with ptable

        """

        ptable_obj = make_partition_table()

        result = PartitionTable.info({'id': ptable_obj['id']})
        self.assertEqual(result.return_code, 0)
        self.assertEqual(len(result.stderr), 0)
        self.assertEqual(ptable_obj['name'], result.stdout['name'])

        new_obj = make_os()
        result = OperatingSys.add_ptable({'id': new_obj['id'],
                                          'ptable': ptable_obj['name']})
        self.assertEqual(result.return_code, 0, "Failed to add ptable")
        self.assertEqual(
            len(result.stderr), 0, "Should not have gotten an error")

        result = OperatingSys.info({'id': new_obj['id']})
        self.assertEqual(result.return_code, 0, "Failed to find object")
        self.assertEqual(len(result.stdout['partition-tables']), 1)
        self.assertIn(ptable_obj['name'], result.stdout['partition-tables'][0])
开发者ID:connornishijima,项目名称:robottelo,代码行数:27,代码来源:test_os.py

示例7: test_positive_add_os_by_name

    def test_positive_add_os_by_name(self):
        """Create a partition table then add an operating system to it using
        names for association

        @Feature: Partition Table

        @Assert: Operating system is added to partition table
        """
        ptable = make_partition_table()
        os = make_os()
        PartitionTable.add_operating_system({
            'name': ptable['name'],
            'operatingsystem': os['title'],
        })
        ptable = PartitionTable.info({'name': ptable['name']})
        self.assertIn(os['title'], ptable['operating-systems'])
开发者ID:anarang,项目名称:robottelo,代码行数:16,代码来源:test_partitiontable.py

示例8: test_positive_update_name

    def test_positive_update_name(self):
        """Create a Partition Table and update its name

        @Feature: Partition Table

        @Assert: Partition Table is created and its name can be updated
        """
        ptable = make_partition_table()
        for new_name in generate_strings_list(length=randint(4, 30)):
            with self.subTest(new_name):
                PartitionTable.update({
                    'id': ptable['id'],
                    'new-name': new_name,
                })
                ptable = PartitionTable.info({'id': ptable['id']})
                self.assertEqual(ptable['name'], new_name)
开发者ID:anarang,项目名称:robottelo,代码行数:16,代码来源:test_partitiontable.py

示例9: test_positive_add_os_by_id

    def test_positive_add_os_by_id(self):
        """Create a partition table then add an operating system to it using
        IDs for association

        :id: 37415a34-5dba-4551-b1c5-e6e59329f4ca

        :expectedresults: Operating system is added to partition table

        :CaseLevel: Integration
        """
        ptable = make_partition_table()
        os = make_os()
        PartitionTable.add_operating_system({
            'id': ptable['id'],
            'operatingsystem-id': os['id'],
        })
        ptable = PartitionTable.info({'id': ptable['id']})
        self.assertIn(os['title'], ptable['operating-systems'])
开发者ID:elyezer,项目名称:robottelo,代码行数:18,代码来源:test_partitiontable.py

示例10: test_positive_add_os_by_name

    def test_positive_add_os_by_name(self):
        """Create a partition table then add an operating system to it using
        names for association

        :id: ad97800a-0ef8-4ee9-ab49-05c82c77017f

        :expectedresults: Operating system is added to partition table

        :CaseLevel: Integration
        """
        ptable = make_partition_table()
        os = make_os()
        PartitionTable.add_operating_system({
            'name': ptable['name'],
            'operatingsystem': os['title'],
        })
        ptable = PartitionTable.info({'name': ptable['name']})
        self.assertIn(os['title'], ptable['operating-systems'])
开发者ID:elyezer,项目名称:robottelo,代码行数:18,代码来源:test_partitiontable.py

示例11: test_positive_update_name

    def test_positive_update_name(self):
        """Create a Partition Table and update its name

        :id: 6242c915-0f15-4d5f-9f7a-73cb58fac81e

        :expectedresults: Partition Table is created and its name can be
            updated

        :CaseImportance: Critical
        """
        ptable = make_partition_table()
        for new_name in generate_strings_list(length=randint(4, 30)):
            with self.subTest(new_name):
                PartitionTable.update({
                    'id': ptable['id'],
                    'new-name': new_name,
                })
                ptable = PartitionTable.info({'id': ptable['id']})
                self.assertEqual(ptable['name'], new_name)
开发者ID:elyezer,项目名称:robottelo,代码行数:19,代码来源:test_partitiontable.py

示例12: test_removeoperatingsystem_ptable

    def test_removeoperatingsystem_ptable(self):
        """@Test: Check if associated operating system can be removed

        @Feature: Partition Table - Add operating system

        @Assert: Operating system removed

        """
        content = gen_string("alpha", 10)
        name = gen_string("alpha", 10)
        try:
            ptable = make_partition_table({'name': name, 'content': content})
            os = make_os()
        except CLIFactoryError as err:
            self.fail(err)

        args = {
            'id': ptable['id'],
            'operatingsystem-id': os['id'],
        }

        result = PartitionTable.add_operating_system(args)
        self.assertEqual(result.return_code, 0, "Association Failed")
        self.assertEqual(len(result.stderr), 0,
                         "There should not be an exception here")

        result = PartitionTable.info({'id': ptable['id']})
        self.assertIn(os['title'],
                      result.stdout['operating-systems'])

        result = PartitionTable.remove_operating_system(args)
        self.assertEqual(result.return_code, 0, "Association Failed")
        self.assertEqual(len(result.stderr), 0,
                         "There should not be an exception here")

        result = PartitionTable.info({'id': ptable['id']})
        self.assertNotIn(
            os['title'],
            result.stdout['operating-systems'])
开发者ID:oshtaier,项目名称:robottelo,代码行数:39,代码来源:test_partitiontable.py

示例13: test_add_ptable

    def test_add_ptable(self):
        """@test: Add ptable to os

        @feature: Operating System - Add ptable

        @assert: Operating System is updated with ptable

        """
        # Create a partition table.
        ptable_name = make_partition_table()['name']
        response = PartitionTable.info({'name': ptable_name})
        self.assertEqual(response.return_code, 0, response.stderr)
        self.assertEqual(len(response.stderr), 0, response.stderr)

        # Create an operating system.
        os_id = make_os()['id']
        response = OperatingSys.info({'id': os_id})
        self.assertEqual(response.return_code, 0, response.stderr)
        self.assertEqual(len(response.stderr), 0, response.stderr)

        # Add the partition table to the operating system.
        response = OperatingSys.add_ptable({
            'id': os_id,
            'partition-table': ptable_name,
        })
        self.assertEqual(response.return_code, 0, response.stderr)
        self.assertEqual(len(response.stderr), 0, response.stderr)

        # Verify that the operating system has a partition table.
        response = OperatingSys.info({'id': os_id})
        self.assertEqual(
            len(response.stdout['partition-tables']),
            1,
            response.stdout['partition-tables']
        )
        self.assertEqual(response.stdout['partition-tables'][0], ptable_name)
开发者ID:oshtaier,项目名称:robottelo,代码行数:36,代码来源:test_os.py

示例14: test_positive_remove_os_by_name

    def test_positive_remove_os_by_name(self):
        """Add an operating system to a partition table then remove it. Use
        names for removal

        @Feature: Partition Table

        @Assert: Operating system is added then removed from partition table
        """
        ptable = make_partition_table()
        os = make_os()
        PartitionTable.add_operating_system({
            'name': ptable['name'],
            'operatingsystem': os['title'],
        })
        ptable = PartitionTable.info({'name': ptable['name']})
        PartitionTable.remove_operating_system({
            'name': ptable['name'],
            'operatingsystem': os['title'],
        })
        ptable = PartitionTable.info({'name': ptable['name']})
        self.assertNotIn(os['title'], ptable['operating-systems'])
开发者ID:anarang,项目名称:robottelo,代码行数:21,代码来源:test_partitiontable.py

示例15: test_positive_remove_os_by_id

    def test_positive_remove_os_by_id(self):
        """Add an operating system to a partition table then remove it

        @Feature: Partition Table

        @Assert: Operating system is added then removed from partition table
        """
        ptable = make_partition_table({'content': gen_string("alpha", 10)})
        os = make_os()
        PartitionTable.add_operating_system({
            'id': ptable['id'],
            'operatingsystem-id': os['id'],
        })
        ptable = PartitionTable.info({'id': ptable['id']})
        self.assertIn(os['title'], ptable['operating-systems'])
        PartitionTable.remove_operating_system({
            'id': ptable['id'],
            'operatingsystem-id': os['id'],
        })
        ptable = PartitionTable.info({'id': ptable['id']})
        self.assertNotIn(os['title'], ptable['operating-systems'])
开发者ID:adammhaile,项目名称:robottelo,代码行数:21,代码来源:test_partitiontable.py


注:本文中的robottelo.cli.partitiontable.PartitionTable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。