Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
msiemens committed Nov 27, 2014
1 parent 2e6adb0 commit 24eb84a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_operations.py
@@ -0,0 +1,17 @@
from tinydb import where
from tinydb.operations import delete, increment, decrement


def test_delete(db):
db.update(delete('int'), where('char') == 'a')
assert 'int' not in db.get(where('char') == 'a')


def test_increment(db):
db.update(increment('int'), where('char') == 'a')
assert db.get(where('char') == 'a')['int'] == 2


def test_decrement(db):
db.update(decrement('int'), where('char') == 'a')
assert db.get(where('char') == 'a')['int'] == 0

0 comments on commit 24eb84a

Please sign in to comment.