vdirsyncer/tests/storage/test_filesystem.py
Markus Unterwaditzer 26a3932289 Fix tmpdir teardown
2014-03-03 17:55:11 +01:00

28 lines
734 B
Python

# -*- coding: utf-8 -*-
'''
vdirsyncer.tests.storage.filesystem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2014 Markus Unterwaditzer
:license: MIT, see LICENSE for more details.
'''
from unittest import TestCase
import tempfile
import shutil
from vdirsyncer.storage.filesystem import FilesystemStorage
from . import StorageTests
class FilesystemStorageTests(TestCase, StorageTests):
tmpdir = None
def _get_storage(self, **kwargs):
path = self.tmpdir = tempfile.mkdtemp()
return FilesystemStorage(path=path, fileext='.txt', **kwargs)
def teardown_method(self, method):
if self.tmpdir is not None:
shutil.rmtree(self.tmpdir)
self.tmpdir = None