From 0022881eb3a15cfc801fec2ce74d34c5d86e43b6 Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Thu, 21 Mar 2019 07:27:18 +0100 Subject: [PATCH] Add db file is set UT --- ut/test_db.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ut/test_db.py b/ut/test_db.py index b6afcf4..c1577f4 100644 --- a/ut/test_db.py +++ b/ut/test_db.py @@ -4,7 +4,7 @@ from os import path, remove from sqlite3 import connect from unittest import TestCase from cbconf import Conf -from cbdb import Db +from cbdb import Db, FileNotSetError TESTDB_FILENAME = ".tmptest.db" @@ -94,3 +94,7 @@ class CoffeeDb(TestCase): self.assertIsNotNone(db.cur) finally: delete_test_db(TESTDB_FILENAME) + +class FailCoffeeDb(TestCase): + def test_db_path_not_set(self): + self.assertRaises(FileNotSetError, Db) -- 2.39.2