Skip to content

Commit 8d60f43

Browse files
authored
Merge pull request #10 from Kpler/add-tests-to-supermarket
chore(supermarket): add tests
2 parents c477955 + 92a53cd commit 8d60f43

34 files changed

Lines changed: 173 additions & 482 deletions

src/supermarket_receipt/.gitignore

Lines changed: 0 additions & 78 deletions
This file was deleted.

src/supermarket_receipt/README.md

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
1-
# Supermarket Receipt in [Python](https://www.python.org/)
1+
# Supermarket Receipt
22

3-
## Setup
4-
5-
* Have Python installed
6-
* Clone the repository
7-
* On the command line, enter the `SupermarketReceipt-Refactoring-Kata/python` directory
8-
* On the command line, install requirements, e.g. on the`python -m pip install -r requirements.txt`
9-
10-
## Running Tests
11-
12-
On the command line, enter the `SupermarketReceipt-Refactoring-Kata/python` directory and run
3+
You are working on the software for a supermarket, in particular for the teller machine that cashiers use to calculate the price of a shopping cart full of items and give the customer a receipt. The supermarket has a catalog of products for sale at various prices. Normally the price of a shopping cart is the sum of the prices of all the items in it. However, at any given time there might be special offers and price reductions on particular products. For example:
134

14-
```
15-
pytest
16-
```
5+
- 10% discount
6+
- 3 for the price of 2
7+
- 2 items for a reduced price
8+
- 5 items for a reduced price
179

18-
## Optional: Running [TextTest](https://www.texttest.org/) Tests
10+
The starting position for this exercise contains the code for setting up the Teller object, a catalog of products, the shopping cart, and any special offers. It can calculate the price of a shopping cart and generate a receipt, but so far there aren't many test cases.
1911

20-
Install TextTest according to the [instructions](https://www.texttest.org/index.html#getting-started-with-texttest) (platform specific).
21-
22-
On the command line, enter the `SupermarketReceipt-Refactoring-Kata/python` directory and run
23-
24-
```
25-
texttest -a sr -d .
26-
```
12+
## Setup
13+
- make a venv
14+
- install requirements, e.g. `python -m pip install -r requirements.txt`
15+
- use pytest to run the tests

src/supermarket_receipt/python/.gitignore

Lines changed: 0 additions & 78 deletions
This file was deleted.

src/supermarket_receipt/python/README.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/supermarket_receipt/python/catalog.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/supermarket_receipt/python/model_objects.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/supermarket_receipt/python/requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/supermarket_receipt/python/tests/test_supermarket.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/supermarket_receipt/receipt.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)