
from senlin.tests.functional import api as test_api
from senlin.tests.functional import base


class TestPolicyType(base.SenlinFunctionalTest):

    def test_get_policy_types(self):
        # Check that listing policy types works.
        policy_types = test_api.list_policy_types(self.client)
        policy_names = [p['name'] for p in policy_types]
        self.assertIn('DeletionPolicy', policy_names)
        self.assertIn('ScalingInPolicy', policy_names)


from senlin.tests.functional import api as test_api
from senlin.tests.functional import base


class TestPolicyType(base.SenlinFunctionalTest):

    def test_get_policy_types(self):
        # Check that listing policy types works.
        policy_types = test_api.list_policy_types(self.client)
        policy_names = [p['name'] for p in policy_types]
        self.assertIn('senlin.policy.deletion', policy_names)
        self.assertIn('senlin.policy.scaling', policy_names)

Fix functional test for policy type listing
Fix functional test for policy type listing

This patch fixes the funtional test for policy type listing. We have
changed the names of builtin policy types.

Change-Id: I9f04ab2a4245e8946db3a0255658676cc5f600ab

  
  from senlin.tests.functional import api as test_api
  from senlin.tests.functional import base
  
  
  class TestPolicyType(base.SenlinFunctionalTest):
  
      def test_get_policy_types(self):
          # Check that listing policy types works.
          policy_types = test_api.list_policy_types(self.client)
          policy_names = [p['name'] for p in policy_types]
+         self.assertIn('senlin.policy.deletion', policy_names)
-         self.assertIn('DeletionPolicy', policy_names)
+         self.assertIn('senlin.policy.scaling', policy_names)
-         self.assertIn('ScalingInPolicy', policy_names)
  
Fix functional test for policy type listing
## Code Before:

from senlin.tests.functional import api as test_api
from senlin.tests.functional import base


class TestPolicyType(base.SenlinFunctionalTest):

    def test_get_policy_types(self):
        # Check that listing policy types works.
        policy_types = test_api.list_policy_types(self.client)
        policy_names = [p['name'] for p in policy_types]
        self.assertIn('DeletionPolicy', policy_names)
        self.assertIn('ScalingInPolicy', policy_names)

## Instruction:
Fix functional test for policy type listing
## Code After:

from senlin.tests.functional import api as test_api
from senlin.tests.functional import base


class TestPolicyType(base.SenlinFunctionalTest):

    def test_get_policy_types(self):
        # Check that listing policy types works.
        policy_types = test_api.list_policy_types(self.client)
        policy_names = [p['name'] for p in policy_types]
        self.assertIn('senlin.policy.deletion', policy_names)
        self.assertIn('senlin.policy.scaling', policy_names)
