WIP: add close method for MagicFolderDB and make MagicFolderDbTests use it.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2016-02-22 16:04:19 +00:00 committed by Brian Warner
parent a50d0e5c8b
commit a78e9c750a
2 changed files with 5 additions and 0 deletions

View File

@ -53,6 +53,9 @@ class MagicFolderDB(object):
self.connection = connection
self.cursor = connection.cursor()
def close(self):
self.connection.close()
def get_db_entry(self, relpath_u):
"""
Retrieve the entry in the database for a given path, or return None

View File

@ -42,6 +42,8 @@ class MagicFolderDbTests(unittest.TestCase):
self.failUnlessEqual(self.db.VERSION, 1)
def tearDown(self):
if hasattr(self, 'db'):
self.db.close()
shutil.rmtree(self.temp)
return super(MagicFolderDbTests, self).tearDown()