Causes get_server_certificate to fail correctly
When no certificate with the name exists, the API should return a 404 (NoSuchEntity).
This commit is contained in:
parent
ae938223d4
commit
4bfbcf4d03
@ -318,6 +318,10 @@ class IAMBackend(BaseBackend):
|
|||||||
if name == cert.cert_name:
|
if name == cert.cert_name:
|
||||||
return cert
|
return cert
|
||||||
|
|
||||||
|
raise IAMNotFoundException(
|
||||||
|
"The Server Certificate with name {0} cannot be "
|
||||||
|
"found.".format(name))
|
||||||
|
|
||||||
def create_group(self, group_name, path='/'):
|
def create_group(self, group_name, path='/'):
|
||||||
if group_name in self.groups:
|
if group_name in self.groups:
|
||||||
raise IAMConflictException("Group {0} already exists".format(group_name))
|
raise IAMConflictException("Group {0} already exists".format(group_name))
|
||||||
|
@ -21,6 +21,14 @@ def test_get_all_server_certs():
|
|||||||
cert1.arn.should.equal("arn:aws:iam::123456789012:server-certificate/certname")
|
cert1.arn.should.equal("arn:aws:iam::123456789012:server-certificate/certname")
|
||||||
|
|
||||||
|
|
||||||
|
@mock_iam()
|
||||||
|
def test_get_server_cert_doesnt_exist():
|
||||||
|
conn = boto.connect_iam()
|
||||||
|
|
||||||
|
with assert_raises(BotoServerError):
|
||||||
|
conn.get_server_certificate("NonExistant")
|
||||||
|
|
||||||
|
|
||||||
@mock_iam()
|
@mock_iam()
|
||||||
def test_get_server_cert():
|
def test_get_server_cert():
|
||||||
conn = boto.connect_iam()
|
conn = boto.connect_iam()
|
||||||
|
Loading…
Reference in New Issue
Block a user