]> rtime.felk.cvut.cz Git - hubacji1/coffee-getter.git/blob - README.md
Merge branch 'feature/database'
[hubacji1/coffee-getter.git] / README.md
1 # Coffeebot getter
2 Somehow friendly API to get and share coffee related data from database.
3
4 # Contribute
5 ## Code
6 For quick orientation see the [changelog][1].
7
8 Please, think about [The seven rules of a great Git commit message][2] when
9 making commit. The project use [OneFlow][3] branching model with the `master`
10 branch as the branch where the development happens.
11
12 ## TDD
13 Test Driven Development (TDD) is used in this project. Each *feature* **must**
14 start with adding test and all the tests **must** pass before merge to the
15 *master*.
16
17 Run the tests by:
18 ```
19 python3 -m unittest discover ut/
20 ```
21
22 See [unittest][5] for start.
23
24 ## Database
25 By default, sqlite3 `coffee.db` file is needed. Please, see [coffee_db.sql][6]
26 for the database format. You may create testing copy of database by:
27 ```
28 wget http://rtime.felk.cvut.cz/gitweb/coffee/coffee-flask.git/blob_plain/refs/heads/master:/coffee_db.sql
29 sqlite3 coffee.db < coffee_db.sql
30 ```
31
32 Then add some testing data by:
33 ```
34 sqlite3 coffee.db "INSERT INTO "users" VALUES('1111','tester')"
35 sqlite3 coffee.db "insert into coffees (id, flavor) values ('1111', 'espresso lungo')"
36 sqlite3 coffee.db "insert into coffees (id, flavor) values ('1111', 'Club-Mate 0,5 l')"
37 sqlite3 coffee.db "insert into coffees (id, flavor) values ('1111', 'Club-Mate 0,33 l')"
38 sleep 1
39 sqlite3 coffee.db "insert into coffees (id, flavor) values ('1111', 'espresso lungo')"
40 sqlite3 coffee.db "insert into coffees (id, flavor) values ('1111', 'Club-Mate 0,5 l')"
41 sqlite3 coffee.db "insert into coffees (id, flavor) values ('1111', 'Club-Mate 0,33 l')"
42 sleep 1
43 sqlite3 coffee.db "insert into coffees (id, flavor) values ('1111', 'espresso lungo')"
44 sqlite3 coffee.db "insert into coffees (id, flavor) values ('1111', 'Club-Mate 0,5 l')"
45 sqlite3 coffee.db "insert into coffees (id, flavor) values ('1111', 'Club-Mate 0,33 l')"
46 sleep 1
47 sqlite3 coffee.db "insert into coffees (id, flavor) values ('1111', 'espresso lungo')"
48 sqlite3 coffee.db "insert into coffees (id, flavor) values ('1111', 'Club-Mate 0,5 l')"
49 sqlite3 coffee.db "insert into coffees (id, flavor) values ('1111', 'Club-Mate 0,33 l')"
50 ```
51
52 Database is needed to pass the tests.
53
54 ## License
55 This project is developed under [GNU GPLv3 license][4].
56
57 [1]: ./CHANGELOG.md
58 [2]: https://chris.beams.io/posts/git-commit/
59 [3]: http://endoflineblog.com/oneflow-a-git-branching-model-and-workflow
60 [4]: ./LICENSE
61 [5]: https://docs.python.org/3.5/library/unittest.html
62 [6]: http://rtime.felk.cvut.cz/gitweb/coffee/coffee-flask.git/blob/refs/heads/master:/coffee_db.sql