• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python utils.create_test_action_plan函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_many_with_soft_deleted_audit_uuid

    def test_many_with_soft_deleted_audit_uuid(self):
        action_plan_list = []
        audit1 = obj_utils.create_test_audit(self.context,
                                             id=1,
                                             uuid=utils.generate_uuid())
        audit2 = obj_utils.create_test_audit(self.context,
                                             id=2,
                                             uuid=utils.generate_uuid())

        for id_ in range(0, 2):
            action_plan = obj_utils.create_test_action_plan(
                self.context, id=id_, uuid=utils.generate_uuid(),
                audit_id=audit1.id)
            action_plan_list.append(action_plan.uuid)

        for id_ in range(2, 4):
            action_plan = obj_utils.create_test_action_plan(
                self.context, id=id_, uuid=utils.generate_uuid(),
                audit_id=audit2.id)
            action_plan_list.append(action_plan.uuid)

        self.delete('/audits/%s' % audit1.uuid)

        response = self.get_json('/action_plans')

        self.assertEqual(len(action_plan_list), len(response['action_plans']))

        for id_ in range(0, 2):
            action_plan = response['action_plans'][id_]
            self.assertIsNone(action_plan['audit_uuid'])

        for id_ in range(2, 4):
            action_plan = response['action_plans'][id_]
            self.assertEqual(audit2.uuid, action_plan['audit_uuid'])
开发者ID:j-carpentier,项目名称:watcher,代码行数:34,代码来源:test_actions_plans.py


示例2: test_filter_by_audit_uuid

    def test_filter_by_audit_uuid(self):
        audit = obj_utils.create_test_audit(self.context,
                                            uuid=utils.generate_uuid())
        action_plan_1 = obj_utils.create_test_action_plan(
            self.context,
            uuid=utils.generate_uuid(),
            audit_id=audit.id)
        action_list = []

        for id_ in range(3):
            action = obj_utils.create_test_action(
                self.context, id=id_,
                action_plan_id=action_plan_1.id,
                uuid=utils.generate_uuid())
            action_list.append(action.uuid)

        audit2 = obj_utils.create_test_audit(self.context,
                                             uuid=utils.generate_uuid())
        action_plan_2 = obj_utils.create_test_action_plan(
            self.context,
            uuid=utils.generate_uuid(),
            audit_id=audit2.id)

        for id_ in range(4, 5, 6):
            obj_utils.create_test_action(
                self.context, id=id_,
                action_plan_id=action_plan_2.id,
                uuid=utils.generate_uuid())

        response = self.get_json('/actions?audit_uuid=%s' % audit.uuid)
        self.assertEqual(len(action_list), len(response['actions']))
        for action in response['actions']:
            self.assertEqual(action_plan_1.uuid, action['action_plan_uuid'])
开发者ID:XroLLla,项目名称:watcher,代码行数:33,代码来源:test_actions.py


示例3: _data_setup

    def _data_setup(self):
        # All the 1's are soft_deleted and are expired
        # All the 2's are soft_deleted but are not expired
        # All the 3's are *not* soft_deleted

        # Number of days we want to keep in DB (no purge for them)
        self.cmd.age_in_days = 10
        self.cmd.max_number = None
        self.cmd.orphans = True
        gen_name = lambda: "Audit Template %s" % uuid.uuid4()
        self.audit_template1_name = gen_name()
        self.audit_template2_name = gen_name()
        self.audit_template3_name = gen_name()

        with freezegun.freeze_time(self.expired_date):
            self.audit_template1 = obj_utils.create_test_audit_template(
                self.context, name=self.audit_template1_name,
                id=self._generate_id(), uuid=None)
            self.audit_template2 = obj_utils.create_test_audit_template(
                self.context, name=self.audit_template2_name,
                id=self._generate_id(), uuid=None)
            self.audit_template3 = obj_utils.create_test_audit_template(
                self.context, name=self.audit_template3_name,
                id=self._generate_id(), uuid=None)
            self.audit_template1.soft_delete()

        with freezegun.freeze_time(self.expired_date):
            self.audit1 = obj_utils.create_test_audit(
                self.context, audit_template_id=self.audit_template1.id,
                id=self._generate_id(), uuid=None)
            self.audit2 = obj_utils.create_test_audit(
                self.context, audit_template_id=self.audit_template2.id,
                id=self._generate_id(), uuid=None)
            self.audit3 = obj_utils.create_test_audit(
                self.context, audit_template_id=self.audit_template3.id,
                id=self._generate_id(), uuid=None)
            self.audit1.soft_delete()

        with freezegun.freeze_time(self.expired_date):
            self.action_plan1 = obj_utils.create_test_action_plan(
                self.context, audit_id=self.audit1.id,
                id=self._generate_id(), uuid=None)
            self.action_plan2 = obj_utils.create_test_action_plan(
                self.context, audit_id=self.audit2.id,
                id=self._generate_id(), uuid=None)
            self.action_plan3 = obj_utils.create_test_action_plan(
                self.context, audit_id=self.audit3.id,
                id=self._generate_id(), uuid=None)

            self.action1 = obj_utils.create_test_action(
                self.context, action_plan_id=self.action_plan1.id,
                id=self._generate_id(), uuid=None)
            self.action2 = obj_utils.create_test_action(
                self.context, action_plan_id=self.action_plan2.id,
                id=self._generate_id(), uuid=None)
            self.action3 = obj_utils.create_test_action(
                self.context, action_plan_id=self.action_plan3.id,
                id=self._generate_id(), uuid=None)
            self.action_plan1.soft_delete()
开发者ID:Jean-Emile,项目名称:watcher,代码行数:59,代码来源:test_purge.py


示例4: setUp

 def setUp(self):
     super(TestDelete, self).setUp()
     obj_utils.create_test_action_plan(self.context)
     self.action = obj_utils.create_test_action(self.context, next=None)
     p = mock.patch.object(db_api.BaseConnection, 'update_action')
     self.mock_action_update = p.start()
     self.mock_action_update.side_effect = self._simulate_rpc_action_update
     self.addCleanup(p.stop)
开发者ID:XroLLla,项目名称:watcher,代码行数:8,代码来源:test_actions.py


示例5: test_find_deleted_and_nonexpired_related_entries

    def test_find_deleted_and_nonexpired_related_entries(self):
        with freezegun.freeze_time(self.fake_today):
            # orphan audit template
            audit_template4 = obj_utils.create_test_audit_template(
                self.context, goal_id=404,  # Does not exist
                name=self.generate_unique_name(prefix="Audit Template 4 "),
                strategy_id=None, id=self._generate_id(), uuid=None)
            audit4 = obj_utils.create_test_audit(
                self.context, audit_template_id=audit_template4.id,
                id=self._generate_id(), uuid=None)
            action_plan4 = obj_utils.create_test_action_plan(
                self.context, audit_id=audit4.id,
                id=self._generate_id(), uuid=None)
            action4 = obj_utils.create_test_action(
                self.context, action_plan_id=action_plan4.id,
                id=self._generate_id(), uuid=None)

            audit_template5 = obj_utils.create_test_audit_template(
                self.context, goal_id=self.goal1.id,
                name=self.generate_unique_name(prefix="Audit Template 5 "),
                strategy_id=None, id=self._generate_id(), uuid=None)
            audit5 = obj_utils.create_test_audit(
                self.context, audit_template_id=audit_template5.id,
                id=self._generate_id(), uuid=None)
            action_plan5 = obj_utils.create_test_action_plan(
                self.context, audit_id=audit5.id,
                id=self._generate_id(), uuid=None)
            action5 = obj_utils.create_test_action(
                self.context, action_plan_id=action_plan5.id,
                id=self._generate_id(), uuid=None)

            self.goal2.soft_delete()
            self.strategy2.soft_delete()
            self.audit_template2.soft_delete()
            self.audit2.soft_delete()
            self.action_plan2.soft_delete()

            # All the 4's should be purged as well because they are orphans
            # even though they were not deleted

            # All the 5's should be purged as well even though they are not
            # expired because their related audit template is itself expired
            audit_template5.soft_delete()
            audit5.soft_delete()
            action_plan5.soft_delete()

        with freezegun.freeze_time(self.fake_today):
            objects_map = self.cmd.find_objects_to_delete()

        self.assertEqual(len(objects_map.goals), 1)
        self.assertEqual(len(objects_map.strategies), 1)
        self.assertEqual(len(objects_map.audit_templates), 3)
        self.assertEqual(len(objects_map.audits), 3)
        self.assertEqual(len(objects_map.action_plans), 3)
        self.assertEqual(len(objects_map.actions), 3)
        self.assertEqual(
            set([self.action1.id, action4.id, action5.id]),
            set([entry.id for entry in objects_map.actions]))
开发者ID:Oliverlyn,项目名称:watcher,代码行数:58,代码来源:test_purge.py


示例6: test_purge_command_with_nonexpired_related_entries

    def test_purge_command_with_nonexpired_related_entries(
            self, m_destroy_audit_template, m_destroy_audit,
            m_destroy_action_plan, m_destroy_action):
        with freezegun.freeze_time(self.fake_today):
            # orphan audit
            audit4 = obj_utils.create_test_audit(
                self.context, audit_template_id=404,  # Does not exist
                id=self._generate_id(), uuid=None)
            action_plan4 = obj_utils.create_test_action_plan(
                self.context, audit_id=audit4.id,
                id=self._generate_id(), uuid=None)
            action4 = obj_utils.create_test_action(
                self.context, action_plan_id=action_plan4.id,
                id=self._generate_id(), uuid=None)

            audit5 = obj_utils.create_test_audit(
                self.context, audit_template_id=self.audit_template1.id,
                id=self._generate_id(), uuid=None)
            action_plan5 = obj_utils.create_test_action_plan(
                self.context, audit_id=audit5.id,
                id=self._generate_id(), uuid=None)
            action5 = obj_utils.create_test_action(
                self.context, action_plan_id=action_plan5.id,
                id=self._generate_id(), uuid=None)

            self.audit_template2.soft_delete()
            self.audit2.soft_delete()
            self.action_plan2.soft_delete()

            # All the 4's should be purged as well because they are orphans
            # even though they were not deleted

            # All the 5's should be purged as well even though they are not
            # expired because their related audit template is itself expired
            audit5.soft_delete()
            action_plan5.soft_delete()

        with freezegun.freeze_time(self.fake_today):
            self.cmd.execute()

        self.assertEqual(m_destroy_audit_template.call_count, 1)
        self.assertEqual(m_destroy_audit.call_count, 3)
        self.assertEqual(m_destroy_action_plan.call_count, 3)
        self.assertEqual(m_destroy_action.call_count, 3)

        m_destroy_audit_template.assert_any_call(self.audit_template1.uuid)
        m_destroy_audit.assert_any_call(self.audit1.uuid)
        m_destroy_audit.assert_any_call(audit4.uuid)
        m_destroy_action_plan.assert_any_call(self.action_plan1.uuid)
        m_destroy_action_plan.assert_any_call(action_plan4.uuid)
        m_destroy_action_plan.assert_any_call(action_plan5.uuid)
        m_destroy_action.assert_any_call(self.action1.uuid)
        m_destroy_action.assert_any_call(action4.uuid)
        m_destroy_action.assert_any_call(action5.uuid)
开发者ID:Jean-Emile,项目名称:watcher,代码行数:54,代码来源:test_purge.py


示例7: test_many_with_sort_key_audit_uuid

    def test_many_with_sort_key_audit_uuid(self):
        audit_list = []
        for id_ in range(5):
            audit = obj_utils.create_test_audit(self.context,
                                                uuid=utils.generate_uuid())
            obj_utils.create_test_action_plan(
                self.context, id=id_, uuid=utils.generate_uuid(),
                audit_id=audit.id)
            audit_list.append(audit.uuid)

        response = self.get_json('/action_plans/?sort_key=audit_uuid')

        self.assertEqual(5, len(response['action_plans']))
        uuids = [s['audit_uuid'] for s in response['action_plans']]
        self.assertEqual(sorted(audit_list), uuids)
开发者ID:j-carpentier,项目名称:watcher,代码行数:15,代码来源:test_actions_plans.py


示例8: test_get_one_with_first_action

 def test_get_one_with_first_action(self):
     action_plan = obj_utils.create_test_action_plan(self.context)
     action = obj_utils.create_test_action(self.context, id=1)
     response = self.get_json('/action_plans/%s' % action_plan['uuid'])
     self.assertEqual(action_plan.uuid, response['uuid'])
     self.assertEqual(action.uuid, response['first_action_uuid'])
     self._assert_action_plans_fields(response)
开发者ID:j-carpentier,项目名称:watcher,代码行数:7,代码来源:test_actions_plans.py


示例9: test_policy_disallow_update

 def test_policy_disallow_update(self):
     action_plan = obj_utils.create_test_action_plan(self.context)
     self._common_policy_check(
         "action_plan:update", self.patch_json,
         '/action_plans/%s' % action_plan.uuid,
         [{'path': '/state', 'value': 'DELETED', 'op': 'replace'}],
         expect_errors=True)
开发者ID:j-carpentier,项目名称:watcher,代码行数:7,代码来源:test_actions_plans.py


示例10: test_detail

 def test_detail(self):
     action_plan = obj_utils.create_test_action_plan(self.context,
                                                     audit_id=None)
     response = self.get_json('/action_plans/detail')
     self.assertEqual(action_plan.uuid,
                      response['action_plans'][0]["uuid"])
     self._assert_action_plans_fields(response['action_plans'][0])
开发者ID:j-carpentier,项目名称:watcher,代码行数:7,代码来源:test_actions_plans.py


示例11: test_many_with_soft_deleted_action_plan_uuid

    def test_many_with_soft_deleted_action_plan_uuid(self):
        action_plan1 = obj_utils.create_test_action_plan(
            self.context,
            id=2,
            uuid=utils.generate_uuid(),
            audit_id=1)
        action_plan2 = obj_utils.create_test_action_plan(
            self.context,
            id=3,
            uuid=utils.generate_uuid(),
            audit_id=1)

        ap1_action_list = []
        ap2_action_list = []

        for id_ in range(0, 2):
            action = obj_utils.create_test_action(
                self.context, id=id_,
                action_plan_id=action_plan1.id,
                uuid=utils.generate_uuid())
            ap1_action_list.append(action)

        for id_ in range(2, 4):
            action = obj_utils.create_test_action(
                self.context, id=id_,
                action_plan_id=action_plan2.id,
                uuid=utils.generate_uuid())
            ap2_action_list.append(action)

        self.delete('/action_plans/%s' % action_plan1.uuid)

        response = self.get_json('/actions')
        # We deleted the actions from the 1st action plan so we've got 2 left
        self.assertEqual(len(ap2_action_list), len(response['actions']))

        # We deleted them so that's normal
        self.assertEqual(
            [act for act in response['actions']
             if act['action_plan_uuid'] == action_plan1.uuid],
            [])

        # Here are the 2 actions left
        self.assertEqual(
            set([act['uuid'] for act in response['actions']
                 if act['action_plan_uuid'] == action_plan2.uuid]),
            set([act.as_dict()['uuid'] for act in ap2_action_list]))
开发者ID:XroLLla,项目名称:watcher,代码行数:46,代码来源:test_actions.py


示例12: test_filter_by_action_plan_and_audit_uuids

 def test_filter_by_action_plan_and_audit_uuids(self):
     audit = obj_utils.create_test_audit(
         self.context, uuid=utils.generate_uuid())
     action_plan = obj_utils.create_test_action_plan(
         self.context,
         uuid=utils.generate_uuid(),
         audit_id=audit.id)
     url = '/actions?action_plan_uuid=%s&audit_uuid=%s' % (
         action_plan.uuid, audit.uuid)
     response = self.get_json(url, expect_errors=True)
     self.assertEqual(400, response.status_int)
开发者ID:XroLLla,项目名称:watcher,代码行数:11,代码来源:test_actions.py


示例13: test_many_with_audit_uuid

 def test_many_with_audit_uuid(self):
     action_plan_list = []
     audit = obj_utils.create_test_audit(self.context,
                                         uuid=utils.generate_uuid())
     for id_ in range(5):
         action_plan = obj_utils.create_test_action_plan(
             self.context, id=id_, uuid=utils.generate_uuid(),
             audit_id=audit.id)
         action_plan_list.append(action_plan.uuid)
     response = self.get_json('/action_plans')
     self.assertEqual(len(action_plan_list), len(response['action_plans']))
     for action in response['action_plans']:
         self.assertEqual(audit.uuid, action['audit_uuid'])
开发者ID:j-carpentier,项目名称:watcher,代码行数:13,代码来源:test_actions_plans.py


示例14: test_get_one_ok

 def test_get_one_ok(self):
     action_plan = obj_utils.create_test_action_plan(self.context)
     obj_utils.create_test_efficacy_indicator(
         self.context, action_plan_id=action_plan['id'])
     response = self.get_json('/action_plans/%s' % action_plan['uuid'])
     self.assertEqual(action_plan.uuid, response['uuid'])
     self._assert_action_plans_fields(response)
     self.assertEqual(
         [{'description': 'Test indicator',
           'name': 'test_indicator',
           'value': 0.0,
           'unit': '%'}],
         response['efficacy_indicators'])
开发者ID:j-carpentier,项目名称:watcher,代码行数:13,代码来源:test_actions_plans.py


示例15: test_many_with_audit_uuid_filter

    def test_many_with_audit_uuid_filter(self):
        action_plan_list1 = []
        audit1 = obj_utils.create_test_audit(self.context,
                                             uuid=utils.generate_uuid())
        for id_ in range(5):
            action_plan = obj_utils.create_test_action_plan(
                self.context, id=id_, uuid=utils.generate_uuid(),
                audit_id=audit1.id)
            action_plan_list1.append(action_plan.uuid)

        audit2 = obj_utils.create_test_audit(self.context,
                                             uuid=utils.generate_uuid())
        action_plan_list2 = []
        for id_ in [5, 6, 7]:
            action_plan = obj_utils.create_test_action_plan(
                self.context, id=id_, uuid=utils.generate_uuid(),
                audit_id=audit2.id)
            action_plan_list2.append(action_plan.uuid)

        response = self.get_json('/action_plans?audit_uuid=%s' % audit2.uuid)
        self.assertEqual(len(action_plan_list2), len(response['action_plans']))
        for action in response['action_plans']:
            self.assertEqual(audit2.uuid, action['audit_uuid'])
开发者ID:j-carpentier,项目名称:watcher,代码行数:23,代码来源:test_actions_plans.py


示例16: test_many_without_soft_deleted

 def test_many_without_soft_deleted(self):
     action_plan_list = []
     for id_ in [1, 2, 3]:
         action_plan = obj_utils.create_action_plan_without_audit(
             self.context, id=id_, uuid=utils.generate_uuid())
         action_plan_list.append(action_plan.uuid)
     for id_ in [4, 5]:
         action_plan = obj_utils.create_test_action_plan(
             self.context, id=id_, uuid=utils.generate_uuid())
         action_plan.soft_delete()
     response = self.get_json('/action_plans')
     self.assertEqual(3, len(response['action_plans']))
     uuids = [s['uuid'] for s in response['action_plans']]
     self.assertEqual(sorted(action_plan_list), sorted(uuids))
开发者ID:j-carpentier,项目名称:watcher,代码行数:14,代码来源:test_actions_plans.py


示例17: test_details_and_filter_by_audit_uuid

    def test_details_and_filter_by_audit_uuid(self):
        audit = obj_utils.create_test_audit(self.context,
                                            uuid=utils.generate_uuid())
        action_plan = obj_utils.create_test_action_plan(
            self.context,
            uuid=utils.generate_uuid(),
            audit_id=audit.id)

        for id_ in range(3):
            action = obj_utils.create_test_action(
                self.context, id=id_,
                action_plan_id=action_plan.id,
                uuid=utils.generate_uuid())

        response = self.get_json(
            '/actions/detail?audit_uuid=%s' % audit.uuid)
        for action in response['actions']:
            self.assertEqual(action_plan.uuid, action['action_plan_uuid'])
开发者ID:XroLLla,项目名称:watcher,代码行数:18,代码来源:test_actions.py


示例18: setUp

 def setUp(self):
     super(TestDefaultActionPlanHandler, self).setUp()
     self.action_plan = obj_utils.create_test_action_plan(
         self.context)
开发者ID:Jean-Emile,项目名称:watcher,代码行数:4,代码来源:test_default_action_handler.py


示例19: _data_setup

    def _data_setup(self):
        # All the 1's are soft_deleted and are expired
        # All the 2's are soft_deleted but are not expired
        # All the 3's are *not* soft_deleted

        # Number of days we want to keep in DB (no purge for them)
        self.cmd.age_in_days = 10
        self.cmd.max_number = None
        self.cmd.orphans = True

        goal1_name = "GOAL_1"
        goal2_name = "GOAL_2"
        goal3_name = "GOAL_3"

        strategy1_name = "strategy_1"
        strategy2_name = "strategy_2"
        strategy3_name = "strategy_3"

        self.audit_template1_name = self.generate_unique_name(
            prefix="Audit Template 1 ")
        self.audit_template2_name = self.generate_unique_name(
            prefix="Audit Template 2 ")
        self.audit_template3_name = self.generate_unique_name(
            prefix="Audit Template 3 ")

        with freezegun.freeze_time(self.expired_date):
            self.goal1 = obj_utils.create_test_goal(
                self.context, id=self._generate_id(), uuid=None,
                name=goal1_name, display_name=goal1_name.lower())
            self.goal2 = obj_utils.create_test_goal(
                self.context, id=self._generate_id(), uuid=None,
                name=goal2_name, display_name=goal2_name.lower())
            self.goal3 = obj_utils.create_test_goal(
                self.context, id=self._generate_id(), uuid=None,
                name=goal3_name, display_name=goal3_name.lower())
            self.goal1.soft_delete()

        with freezegun.freeze_time(self.expired_date):
            self.strategy1 = obj_utils.create_test_strategy(
                self.context, id=self._generate_id(), uuid=None,
                name=strategy1_name, display_name=strategy1_name.lower(),
                goal_id=self.goal1.id)
            self.strategy2 = obj_utils.create_test_strategy(
                self.context, id=self._generate_id(), uuid=None,
                name=strategy2_name, display_name=strategy2_name.lower(),
                goal_id=self.goal2.id)
            self.strategy3 = obj_utils.create_test_strategy(
                self.context, id=self._generate_id(), uuid=None,
                name=strategy3_name, display_name=strategy3_name.lower(),
                goal_id=self.goal3.id)
            self.strategy1.soft_delete()

        with freezegun.freeze_time(self.expired_date):
            self.audit_template1 = obj_utils.create_test_audit_template(
                self.context, name=self.audit_template1_name,
                id=self._generate_id(), uuid=None, goal_id=self.goal1.id,
                strategy_id=self.strategy1.id)
            self.audit_template2 = obj_utils.create_test_audit_template(
                self.context, name=self.audit_template2_name,
                id=self._generate_id(), uuid=None, goal_id=self.goal2.id,
                strategy_id=self.strategy2.id)
            self.audit_template3 = obj_utils.create_test_audit_template(
                self.context, name=self.audit_template3_name,
                id=self._generate_id(), uuid=None, goal_id=self.goal3.id,
                strategy_id=self.strategy3.id)
            self.audit_template1.soft_delete()

        with freezegun.freeze_time(self.expired_date):
            self.audit1 = obj_utils.create_test_audit(
                self.context, audit_template_id=self.audit_template1.id,
                id=self._generate_id(), uuid=None)
            self.audit2 = obj_utils.create_test_audit(
                self.context, audit_template_id=self.audit_template2.id,
                id=self._generate_id(), uuid=None)
            self.audit3 = obj_utils.create_test_audit(
                self.context, audit_template_id=self.audit_template3.id,
                id=self._generate_id(), uuid=None)
            self.audit1.soft_delete()

        with freezegun.freeze_time(self.expired_date):
            self.action_plan1 = obj_utils.create_test_action_plan(
                self.context, audit_id=self.audit1.id,
                id=self._generate_id(), uuid=None)
            self.action_plan2 = obj_utils.create_test_action_plan(
                self.context, audit_id=self.audit2.id,
                id=self._generate_id(), uuid=None)
            self.action_plan3 = obj_utils.create_test_action_plan(
                self.context, audit_id=self.audit3.id,
                id=self._generate_id(), uuid=None)

            self.action1 = obj_utils.create_test_action(
                self.context, action_plan_id=self.action_plan1.id,
                id=self._generate_id(), uuid=None)
            self.action2 = obj_utils.create_test_action(
                self.context, action_plan_id=self.action_plan2.id,
                id=self._generate_id(), uuid=None)
            self.action3 = obj_utils.create_test_action(
                self.context, action_plan_id=self.action_plan3.id,
                id=self._generate_id(), uuid=None)
            self.action_plan1.soft_delete()
开发者ID:Oliverlyn,项目名称:watcher,代码行数:100,代码来源:test_purge.py


示例20: test_policy_disallow_delete

 def test_policy_disallow_delete(self):
     action_plan = obj_utils.create_test_action_plan(self.context)
     self._common_policy_check(
         "action_plan:delete", self.delete,
         '/action_plans/%s' % action_plan.uuid, expect_errors=True)
开发者ID:j-carpentier,项目名称:watcher,代码行数:5,代码来源:test_actions_plans.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.create_test_audit函数代码示例发布时间:2022-05-26
下一篇:
Python utils.create_test_action函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap