80 days ago · Tech · hide · Fediverse post

Python A-Z is a blog series about Python. Each day, I share insights, ideas and examples for different parts of Python development that match with the letter of the day. Blaugust is an annual blogging festival in August where the goal is to write a blog post every day of the month. Welcome to Z. The last day of our journey through Python from A to Z. I initially considered writing about zip but I already wrote about zip in Batteries included two years ago and I don’t have anything new to say about it. A while ago in a project, I had to test a function that downloaded a zip file, read an XML file from it and returned some value. I needed to figure out a way to mock an HTTP GET request to return a zip file. Setup In our project, there was a third party library that downloaded a zip file from a hard-coded URL, read a file inside it and returned some data for us. I couldn’t change the function but needed to write a test to keep us safe from changes in that function that would cause hard…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town