← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1413459] [NEW] test_ec2_list_credentials does a wrong test

 

Public bug reported:

https://github.com/openstack/keystone/blob/master/keystone/tests/test_v3_credential.py#L370
    def test_ec2_list_credentials(self):
        """Test ec2 credential listing."""
        self._get_ec2_cred_uri()
        uri = self._get_ec2_cred_uri()
        r = self.get(uri)
        cred_list = r.result
        self.assertEqual(1, len(cred_list))
According to current code, I think the test steps is:
1. create a ec2 credential
2. list all credentials
3. assert that list method can get the ec2 credential created before
But, the author used a wrong method to create ec2 credential and asserted the wrong data:
1. The method which creates a ec2 credential is self._get_ec2_cred()
2. cred_list should be r.result['credentials']

** Affects: keystone
     Importance: Undecided
     Assignee: wanghong (w-wanghong)
         Status: In Progress

** Changed in: keystone
     Assignee: (unassigned) => wanghong (w-wanghong)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1413459

Title:
  test_ec2_list_credentials does a wrong test

Status in OpenStack Identity (Keystone):
  In Progress

Bug description:
  https://github.com/openstack/keystone/blob/master/keystone/tests/test_v3_credential.py#L370
      def test_ec2_list_credentials(self):
          """Test ec2 credential listing."""
          self._get_ec2_cred_uri()
          uri = self._get_ec2_cred_uri()
          r = self.get(uri)
          cred_list = r.result
          self.assertEqual(1, len(cred_list))
  According to current code, I think the test steps is:
  1. create a ec2 credential
  2. list all credentials
  3. assert that list method can get the ec2 credential created before
  But, the author used a wrong method to create ec2 credential and asserted the wrong data:
  1. The method which creates a ec2 credential is self._get_ec2_cred()
  2. cred_list should be r.result['credentials']

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1413459/+subscriptions


Follow ups

References