How to mock __import__ built-in function
So lets say we need to write unit test for piece of code that uses __import__ built-in function: def task_we_want_to_test(task_name: str, task_class: str, env: dict) -> Task: module = __import__(…
So lets say we need to write unit test for piece of code that uses __import__ built-in function: def task_we_want_to_test(task_name: str, task_class: str, env: dict) -> Task: module = __import__(…
The naming convention, I propose, have four sections: Story Type: add == Add Feature fix == Fix, Hotfix, Bug, … clean == Cleanup, Chore, … modify == Modify existing functionality Short Summary: 2-3…
This was my first EuroPython conference and I had high expectations because I heard a lot of good things about it. I must say that overall it didn’t let me…
My cheat sheet for postgresql. Also pgcli is a really nice tool to use. IMO with it you don’t need any “phpMyAdmin” tools. Update query: UPDATE blogs SET posts=0, pages=0, plugins=0, health_score=0…
In previous post we look at how basic mocking works and some examples. Today we will see how you can mock dict : post = { “name”: “test”, “content”: “tist”, }…
Before we start writing tests let’s make sure that we understand why do we want to write unit tests and the concept of unit testing. Here are a few reasons (from my…
A few days ago I had a problem where mongodb crashed and I couldn’t start it up. I realized that this problem occurred because the disk was full. So I rm…
When I started using git (several years ago) I use only git command line. After a few years I decided to start using SourceTree. I regret this decision to this…
I tried to follow a few tutorials / howtos but non of them worked perfectly so I decided to write my own how-to. If nothing else I will know which one…
To remove one super product attribute (as they are called) from all configurable products, you could execute this SQL query in the database: The table catalog_product_super_attribute links products to super product attributes. You can…