forked from Br0ckers/PyBook
/
test_spec.py
25 lines (20 loc) · 881 Bytes
/
test_spec.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from mamba import description, context, it
import apple
with description('Database Management') as self:
with context('find a user'):
with it('returns a user'):
assert(apple.find_one_user("joe bloggs")) == "joe bloggs"
with description('Database Management') as self:
with context('find all users'):
with it('returns all users'):
assert(apple.find_user_count()) > 0
with description('Database Management') as self:
with context('finsert a user'):
with it('inserts a user'):
apple.insert_one_user()
assert(apple.find_one_user("winston wolf")) == "winston wolf"
with description('Database Management') as self:
with context('delete a user'):
with it('delete a user'):
apple.delete_one_user("winston wolf")
assert(apple.find_one_user("winston wolf")) == None