try: from urllib import quote_plus except ImportError: from urllib.parse import quote_plus from xml.sax.saxutils import escape from write_rss_feed import FEED_FILENAME, lambda_handler def test_rss_feed_written( mocked_s3, uploaded_episodes, bucket, folder, domain, event): lambda_handler(event, context=None) feed_path = '{}/feed.xml'.format(folder) feed_xml = mocked_s3.get_object( Bucket=bucket, Key=feed_path)['Body'].read().decode() mp3s = [ e['Key'] for e in mocked_s3.list_objects_v2(Bucket=bucket)['Contents'] if e['Key'].endswith('.mp3') ] for mp3 in mp3s: enclosure = '