Remove unnecessary class from helpers.file_utils

A class which keeps track of temporary files and removes them
automatically when they're not needed anymore might be a good idea,
but this implementation didn't remove files in some cases. Adding
unrelated methods that could as well be just standalone functions
is bad design, too.

In this case, it's better to just get rid of it altogether instead
of fixing it, since Python 3 has a TemporaryDirectory class, which
can be used for the same purpose and is definitely more
battle-tested.
This commit is contained in:
flan
2017-11-04 00:22:09 +01:00
parent e959d8745a
commit a48ad44a65
5 changed files with 82 additions and 207 deletions

View File

@@ -5,7 +5,6 @@ from webtest import TestApp
from ankisyncd.users import SqliteUserManager
from helpers.collection_utils import CollectionUtils
from helpers.file_utils import FileUtils
from helpers.mock_servers import MockRemoteServer
from helpers.monkey_patches import monkeypatch_db, unpatch_db
from helpers.server_utils import ServerUtils
@@ -15,15 +14,11 @@ class SyncAppFunctionalTestBase(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.fileutils = FileUtils()
cls.colutils = CollectionUtils()
cls.serverutils = ServerUtils()
@classmethod
def tearDownClass(cls):
cls.fileutils.clean_up()
cls.fileutils = None
cls.colutils.clean_up()
cls.colutils = None