def test_delete_permissions_actually_deletes(self):
        self.client.add_permission(QueueUrl=self.queue_url, Label="other_permission",
                                   AWSAccountIds=[self.account_id], Actions=['SendMessage'])
        self.client.add_permission(QueueUrl=self.queue_url, Label="test_permission",
                                   AWSAccountIds=[self.account_id], Actions=['*'])

        permission_lambda.delete_permissions(self.queue_url, "test_permission")
        time.sleep(1)

        permission_statements = self._get_permission_statements()
        test_permissions = [statement['Sid'] for statement in permission_statements]
        self.assertEqual(test_permissions, ["other_permission"])
 def test_delete_permissions_handles_nonexisting_label(self):
     permission_lambda.delete_permissions(self.queue_url, "foobar")