Merge pull request #462 from rachmadaniHaryono/bugfix/travis
Bugfix/travis
This commit is contained in:
commit
fc41c62f62
5
buku
5
buku
@ -1474,6 +1474,11 @@ class BukuDb:
|
||||
True if record should not be committed to the DB,
|
||||
leaving commit responsibility to caller. Default is False.
|
||||
|
||||
Raises
|
||||
------
|
||||
TypeError
|
||||
If any of index, low, or high variable is not integer.
|
||||
|
||||
Returns
|
||||
-------
|
||||
bool
|
||||
|
@ -936,16 +936,14 @@ def test_delete_rec_on_non_interger(index, low, high, is_range):
|
||||
|
||||
for bookmark in TEST_BOOKMARKS:
|
||||
bdb.add_rec(*bookmark)
|
||||
db_len = len(TEST_BOOKMARKS)
|
||||
|
||||
if is_range and not (isinstance(low, int) and isinstance(high, int)):
|
||||
with pytest.raises(TypeError):
|
||||
bdb.delete_rec(index=index, low=low, high=high, is_range=is_range)
|
||||
return
|
||||
if not is_range and not isinstance(index, int):
|
||||
res = bdb.delete_rec(index=index, low=low, high=high, is_range=is_range)
|
||||
assert not res
|
||||
assert len(bdb.get_rec_all()) == db_len
|
||||
with pytest.raises(TypeError):
|
||||
bdb.delete_rec(index=index, low=low, high=high, is_range=is_range)
|
||||
else:
|
||||
assert bdb.delete_rec(index=index, low=low, high=high, is_range=is_range)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user