fixing test_print_bookmark
This commit is contained in:
parent
29b8cf5b6e
commit
58fc2fd5e9
@ -4,7 +4,7 @@ python:
|
||||
- "3.4"
|
||||
- "3.5"
|
||||
before_install:
|
||||
- pip install pytest pytest-cov
|
||||
- pip install pytest pytest-cov pytest-catchlog
|
||||
install: "pip install -r requirements.txt"
|
||||
addons:
|
||||
apt:
|
||||
|
@ -234,14 +234,17 @@ class TestBukuDb(unittest.TestCase):
|
||||
# def test_import_bookmark(self):
|
||||
# self.fail()
|
||||
|
||||
def test_print_bookmark(capsys, setup):
|
||||
def test_print_bookmark(capsys, caplog, setup):
|
||||
bdb = BukuDb()
|
||||
out, err = capsys.readouterr()
|
||||
# calling with nonexistent index
|
||||
bdb.print_bookmark(1)
|
||||
out, err = capsys.readouterr()
|
||||
#assert out == "[ERROR] No matching index"
|
||||
assert err == ''
|
||||
|
||||
for record in caplog.records:
|
||||
assert record.levelname == "ERROR"
|
||||
assert record.getMessage() == "No matching index"
|
||||
assert (out, err) == ('', '')
|
||||
|
||||
# adding bookmarks
|
||||
bdb.add_bookmark("http://full-bookmark.com", "full", parse_tags(['full,bookmark']), "full bookmark")
|
||||
|
Loading…
Reference in New Issue
Block a user