BeckiW / cafefikakata

☕ TDD Kata for python focusing around types&mypy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cafe Fika Kata

Setup

Locally run pipenv install. If you don't have pip installed you'll need to run pip install pipenv first.

Once this is setup run ./test.sh

Kata Requirements

Requirement One - Pricing

We want to be able to find out the price of some simple items

Coffee - 5kr Fancy Coffee - 8kr Kanelbulle - 10kr

Requirement Two - Basket shopping

We get a list of items from the customer. What's the total?

Requirement Three - Special offers

There's now a special offer on the bullar. If a customer buys 3 they only pay 25kr.

Requirement Four - Different cafes have different prices

Extend the above so we can have multiple shops with different prices

Requirement Four and a half - Different deals

If you only extended the above for prices do the same for deals

Requirement Five - Stock levels

A cafe has limited stock. When it's sold out orders can't be placed for that time.

Requirement Six - Closing down

When a cafe has no stock of any kind it closes down.

Requirement Seven - Let's take fika international

All the previous requirements dealt in Krona. Now we want to launch in new countries. Each cafe should only work in a single currency.

Considerations

Part of the focus of this Kata is using the type system with mypy.

When defining your functions and classes start to think about what types they will receive and output. Dataclasses added in 3.7 can also help with this.

About

☕ TDD Kata for python focusing around types&mypy


Languages

Language:Python 50.1%Language:Shell 49.9%