From d0ef116a0b4428190f31ed22a0089ffdf530dffb Mon Sep 17 00:00:00 2001 From: rachmadaniHaryono Date: Wed, 2 Jan 2019 03:35:22 +0800 Subject: [PATCH 1/2] new: dev: fix test test_cleardb --- tests/test_bukuDb.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/test_bukuDb.py b/tests/test_bukuDb.py index 334f63a..1a101d8 100644 --- a/tests/test_bukuDb.py +++ b/tests/test_bukuDb.py @@ -582,11 +582,7 @@ class TestBukuDb(unittest.TestCase): with mock.patch('builtins.input', return_value='y'): self.bdb.cleardb() # assert table has been dropped - with self.assertRaises(sqlite3.OperationalError) as ctx_man: - self.bdb.get_rec_by_id(0) - - err_msg = str(ctx_man.exception) - self.assertEqual(err_msg, 'no such table: bookmarks') + assert self.bdb.get_rec_by_id(0) # @unittest.skip('skipping') def test_replace_tag(self): From acc08c1ec80622cb4ec301dfe5118e87556a30a8 Mon Sep 17 00:00:00 2001 From: rachmadaniHaryono Date: Wed, 2 Jan 2019 03:41:24 +0800 Subject: [PATCH 2/2] chg: test: assert none --- tests/test_bukuDb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_bukuDb.py b/tests/test_bukuDb.py index 1a101d8..d993f24 100644 --- a/tests/test_bukuDb.py +++ b/tests/test_bukuDb.py @@ -582,7 +582,7 @@ class TestBukuDb(unittest.TestCase): with mock.patch('builtins.input', return_value='y'): self.bdb.cleardb() # assert table has been dropped - assert self.bdb.get_rec_by_id(0) + assert self.bdb.get_rec_by_id(0) is None # @unittest.skip('skipping') def test_replace_tag(self):