* (fix) Fixes #3648 * (fix) formatting * (review) add assertion for exception thrown
This commit is contained in:
parent
7d066cea2f
commit
81859f9180
@ -827,9 +827,10 @@ Member must satisfy regular expression pattern: {}".format(
|
||||
for load_balancer in self.load_balancers.values():
|
||||
for listener_arn in listener_arns:
|
||||
listener = load_balancer.listeners.get(listener_arn)
|
||||
if not listener:
|
||||
raise ListenerNotFoundError()
|
||||
matched.append(listener)
|
||||
if listener:
|
||||
matched.append(listener)
|
||||
if listener_arns and len(matched) == 0:
|
||||
raise ListenerNotFoundError()
|
||||
return matched
|
||||
|
||||
def delete_load_balancer(self, arn):
|
||||
|
@ -415,10 +415,9 @@ def test_create_target_group_and_listeners():
|
||||
response.get("LoadBalancers").should.have.length_of(0)
|
||||
|
||||
# And it deleted the remaining listener
|
||||
response = conn.describe_listeners(
|
||||
ListenerArns=[http_listener_arn, https_listener_arn]
|
||||
)
|
||||
response.get("Listeners").should.have.length_of(0)
|
||||
with pytest.raises(ClientError) as e:
|
||||
conn.describe_listeners(ListenerArns=[http_listener_arn, https_listener_arn])
|
||||
e.value.response["Error"]["Code"].should.equal("ListenerNotFound")
|
||||
|
||||
# But not the target groups
|
||||
response = conn.describe_target_groups()
|
||||
|
Loading…
Reference in New Issue
Block a user