mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Tests: Remove "temp file" from comments
Update the comments to not mention the usage of temp file for logging regarding the instances of the TestServerProcess class. Also, remove one unused import. Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
This commit is contained in:
parent
ea20e86380
commit
ad9c82409d
12 changed files with 24 additions and 30 deletions
|
|
@ -82,7 +82,7 @@ def setUpClass(cls):
|
|||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
# Kills the server subprocess and closes the temp file used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
cls.server_process_handler.clean()
|
||||
|
||||
# Remove the temporary repository directory, which should contain all the
|
||||
|
|
|
|||
|
|
@ -90,8 +90,7 @@ def setUp(self):
|
|||
def tearDown(self):
|
||||
unittest_toolbox.Modified_TestCase.tearDown(self)
|
||||
|
||||
# Logs stdout and stderr from the server subprocess and then it
|
||||
# kills it and closes the temp file used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
self.server_process_handler.clean()
|
||||
|
||||
self.target_fileobj.close()
|
||||
|
|
@ -367,8 +366,7 @@ def test_https_connection(self):
|
|||
bad_https_server_handler,
|
||||
expd_https_server_handler]:
|
||||
|
||||
# Logs stdout and stderr from the server subprocess and then it
|
||||
# kills it and closes the temp file used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
proc_handler.clean()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ def setUpClass(cls):
|
|||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
# Kills the server subprocess and closes the temp file used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
cls.server_process_handler.clean()
|
||||
|
||||
# Remove the temporary repository directory, which should contain all the
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ def setUpClass(cls):
|
|||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
# Kills the server subprocess and closes the temp file used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
cls.server_process_handler.clean()
|
||||
|
||||
# Remove the temporary repository directory, which should contain all the
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ def setUpClass(cls):
|
|||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
# Kills the server subprocess and closes the temp file used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
cls.server_process_handler.clean()
|
||||
|
||||
# Remove the temporary repository directory, which should contain all the
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ def setUpClass(cls):
|
|||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
# Kills the server subprocess and closes the temp file used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
cls.server_process_handler.clean()
|
||||
|
||||
# Remove the temporary repository directory, which should contain all the
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ def setUpClass(cls):
|
|||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
# Kills the server subprocess and closes the temp file used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
cls.server_process_handler.clean()
|
||||
|
||||
# Remove the temporary repository directory, which should contain all the
|
||||
|
|
|
|||
|
|
@ -124,13 +124,13 @@ def setUp(self):
|
|||
# has been changed when executing a subprocess.
|
||||
SIMPLE_SERVER_PATH = os.path.join(os.getcwd(), 'simple_server.py')
|
||||
|
||||
# Creates a subprocess running server and uses temp file for logging.
|
||||
# Creates a subprocess running a server.
|
||||
self.server_process_handler = utils.TestServerProcess(log=logger,
|
||||
server=SIMPLE_SERVER_PATH, popen_cwd=self.repository_directory)
|
||||
|
||||
logger.debug('Server process started.')
|
||||
|
||||
# Creates a subprocess running server and uses temp file for logging.
|
||||
# Creates a subprocess running a server.
|
||||
self.server_process_handler2 = utils.TestServerProcess(log=logger,
|
||||
server=SIMPLE_SERVER_PATH, popen_cwd=self.repository_directory2)
|
||||
|
||||
|
|
@ -160,8 +160,7 @@ def tearDown(self):
|
|||
# directories that may have been created during each test case.
|
||||
unittest_toolbox.Modified_TestCase.tearDown(self)
|
||||
|
||||
# Logs stdout and stderr from the server subprocesses and then it
|
||||
# kills them and closes the temp files used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
self.server_process_handler.clean()
|
||||
self.server_process_handler2.clean()
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ def setUpClass(cls):
|
|||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
# Kills the server subprocess and closes the temp file used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
cls.server_process_handler.clean()
|
||||
|
||||
# Remove the temporary repository directory, which should contain all the
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@
|
|||
|
||||
import os
|
||||
import tempfile
|
||||
import time
|
||||
import shutil
|
||||
import logging
|
||||
import unittest
|
||||
|
|
@ -196,8 +195,7 @@ def tearDown(self):
|
|||
tuf.roledb.clear_roledb(clear_all=True)
|
||||
tuf.keydb.clear_keydb(clear_all=True)
|
||||
|
||||
# Logs stdout and stderr from the server subprocess and then it
|
||||
# kills it and closes the temp file used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
self.server_process_handler.clean()
|
||||
|
||||
# Remove the temporary repository directory, which should contain all the
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ def setUpClass(cls):
|
|||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
# Kills the server subprocess and closes the temp file used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
cls.server_process_handler.clean()
|
||||
|
||||
# Remove the temporary repository directory, which should contain all the
|
||||
|
|
@ -1082,7 +1082,7 @@ def test_6_get_one_valid_targetinfo(self):
|
|||
# The SimpleHTTPServer started in the setupclass has a tendency to
|
||||
# timeout in Windows after a few tests.
|
||||
|
||||
# Creates a subprocess running server and uses temp file for logging.
|
||||
# Creates a subprocess running a server.
|
||||
server_process_handler = utils.TestServerProcess(log=logger,
|
||||
server=self.SIMPLE_SERVER_PATH)
|
||||
|
||||
|
|
@ -1206,7 +1206,7 @@ def test_6_get_one_valid_targetinfo(self):
|
|||
self.repository_updater.get_one_valid_targetinfo,
|
||||
'/foo/foo1.1.tar.gz')
|
||||
|
||||
# Kills the server subprocess and closes the temp file used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
server_process_handler.clean()
|
||||
|
||||
|
||||
|
|
@ -1376,7 +1376,7 @@ def test_7_updated_targets(self):
|
|||
# The SimpleHTTPServer started in the setupclass has a tendency to
|
||||
# timeout in Windows after a few tests.
|
||||
|
||||
# Creates a subprocess running server and uses temp file for logging.
|
||||
# Creates a subprocess running a server.
|
||||
server_process_handler = utils.TestServerProcess(log=logger,
|
||||
server=self.SIMPLE_SERVER_PATH)
|
||||
|
||||
|
|
@ -1491,7 +1491,7 @@ def test_7_updated_targets(self):
|
|||
self.repository_updater.updated_targets(all_targets, destination_directory)
|
||||
self.assertEqual(len(updated_targets), 1)
|
||||
|
||||
# Kills the server subprocess and closes the temp file used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
server_process_handler.clean()
|
||||
|
||||
|
||||
|
|
@ -1503,7 +1503,7 @@ def test_8_remove_obsolete_targets(self):
|
|||
# The SimpleHTTPServer started in the setupclass has a tendency to
|
||||
# timeout in Windows after a few tests.
|
||||
|
||||
# Creates a subprocess running server and uses temp file for logging.
|
||||
# Creates a subprocess running a server.
|
||||
server_process_handler = utils.TestServerProcess(log=logger,
|
||||
server=self.SIMPLE_SERVER_PATH)
|
||||
|
||||
|
|
@ -1594,7 +1594,7 @@ def test_8_remove_obsolete_targets(self):
|
|||
del self.repository_updater.metadata['previous']['targets']
|
||||
self.repository_updater.remove_obsolete_targets(destination_directory)
|
||||
|
||||
# Kills the server subprocess and closes the temp file used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
server_process_handler.clean()
|
||||
|
||||
|
||||
|
|
@ -1864,13 +1864,13 @@ def setUp(self):
|
|||
# as a delegated role 'targets/role1', three target files, five key files,
|
||||
# etc.
|
||||
|
||||
# Creates a subprocess running server and uses temp file for logging.
|
||||
# Creates a subprocess running a server.
|
||||
self.server_process_handler = utils.TestServerProcess(log=logger,
|
||||
server=self.SIMPLE_SERVER_PATH, popen_cwd=self.repository_directory)
|
||||
|
||||
logger.debug('Server process started.')
|
||||
|
||||
# Creates a subprocess running server and uses temp file for logging.
|
||||
# Creates a subprocess running a server.
|
||||
self.server_process_handler2 = utils.TestServerProcess(log=logger,
|
||||
server=self.SIMPLE_SERVER_PATH, popen_cwd=self.repository_directory2)
|
||||
|
||||
|
|
@ -1923,8 +1923,7 @@ def tearDown(self):
|
|||
# directories that may have been created during each test case.
|
||||
unittest_toolbox.Modified_TestCase.tearDown(self)
|
||||
|
||||
# Logs stdout and stderr from the server subprocesses and then it
|
||||
# kills them and closes the temp files used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
self.server_process_handler.clean()
|
||||
self.server_process_handler2.clean()
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ def setUpClass(cls):
|
|||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
# Kills the server subprocess and closes the temp file used for logging.
|
||||
# Cleans the resources and flush the logged lines (if any).
|
||||
cls.server_process_handler.clean()
|
||||
|
||||
# Remove the temporary repository directory, which should contain all the
|
||||
|
|
|
|||
Loading…
Reference in a new issue