Skip to content

Karantan's blog

  • Home
  • Contact
  • About me

Author: Jayden Steward

September 28, 2016September 28, 2016

Releasing Python Packages

When you need to fix a bug, add feature or change existing functionality in a library that you are using there are several ways to do this. Here I will…

Continue reading
September 9, 2016

How to mock ‘open’ built-in function

Here is a code snippet on how to test open built-in function: Code to test: def my_function(self, id: int) -> None: file_path = ‘path/to/files/{}.txt’.format(id) with open(file_path, ‘w’) as f: f.write(‘< My data…

Continue reading
September 5, 2016September 5, 2016

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__(…

Continue reading
August 18, 2016October 7, 2016

Git branch naming convention

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…

Continue reading
August 2, 2016September 28, 2016

Lessons learned from EuroPython 2016

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…

Continue reading
April 15, 2016January 4, 2017

PostgreSQL quick examples

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…

Continue reading
April 12, 2016April 15, 2016

More Python mocking: dictionary

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”, }…

Continue reading
January 30, 2016January 30, 2016

Unit testing in Python with mock

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…

Continue reading
January 24, 2016

MongoDB not starting up

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…

Continue reading
January 21, 2016April 10, 2018

Git basics: workflow, pull request, rebasing, …

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…

Continue reading

Posts navigation

Older posts
Newer posts


Archives

Tag Cloud

conda Git Go Lessons learned logs Magento Mock Mongodb nix nixops nixos PostgreSQL Python Python3 Rsync systemd tmux Unit testing
Proudly powered by WordPress | Theme: Gently by MusterThemes.