fix: tweak methods for FileConfigTestCase
This commit is contained in:
parent
3e3f7ac958
commit
e3e3b004aa
|
@ -2,7 +2,7 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# WuttJamaican -- Base package for Wutta Framework
|
# WuttJamaican -- Base package for Wutta Framework
|
||||||
# Copyright © 2023 Lance Edgar
|
# Copyright © 2023-2024 Lance Edgar
|
||||||
#
|
#
|
||||||
# This file is part of Wutta Framework.
|
# This file is part of Wutta Framework.
|
||||||
#
|
#
|
||||||
|
@ -27,6 +27,7 @@ WuttJamaican - test utilities
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import warnings
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,9 +50,9 @@ class FileConfigTestCase(TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
""" """
|
""" """
|
||||||
self.setup_file_config()
|
self.setup_files()
|
||||||
|
|
||||||
def setup_file_config(self):
|
def setup_files(self):
|
||||||
"""
|
"""
|
||||||
Setup logic specific to the ``FileConfigTestCase``.
|
Setup logic specific to the ``FileConfigTestCase``.
|
||||||
|
|
||||||
|
@ -59,11 +60,18 @@ class FileConfigTestCase(TestCase):
|
||||||
"""
|
"""
|
||||||
self.tempdir = tempfile.mkdtemp()
|
self.tempdir = tempfile.mkdtemp()
|
||||||
|
|
||||||
|
def setup_file_config(self): # pragma: no cover
|
||||||
|
""" """
|
||||||
|
warnings.warn("FileConfigTestCase.setup_file_config() is deprecated; "
|
||||||
|
"please use setup_files() instead",
|
||||||
|
DeprecationWarning, stacklevel=2)
|
||||||
|
self.setup_files()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
""" """
|
""" """
|
||||||
self.teardown_file_config()
|
self.teardown_files()
|
||||||
|
|
||||||
def teardown_file_config(self):
|
def teardown_files(self):
|
||||||
"""
|
"""
|
||||||
Teardown logic specific to the ``FileConfigTestCase``.
|
Teardown logic specific to the ``FileConfigTestCase``.
|
||||||
|
|
||||||
|
@ -71,6 +79,13 @@ class FileConfigTestCase(TestCase):
|
||||||
"""
|
"""
|
||||||
shutil.rmtree(self.tempdir)
|
shutil.rmtree(self.tempdir)
|
||||||
|
|
||||||
|
def teardown_file_config(self): # pragma: no cover
|
||||||
|
""" """
|
||||||
|
warnings.warn("FileConfigTestCase.teardown_file_config() is deprecated; "
|
||||||
|
"please use teardown_files() instead",
|
||||||
|
DeprecationWarning, stacklevel=2)
|
||||||
|
self.teardown_files()
|
||||||
|
|
||||||
def write_file(self, filename, content):
|
def write_file(self, filename, content):
|
||||||
"""
|
"""
|
||||||
Write a new file (in temporary folder) with the given filename
|
Write a new file (in temporary folder) with the given filename
|
||||||
|
|
Loading…
Reference in a new issue