set timezone to US/Eastern when test_build_notification executing
following PR#628
This commit is contained in:
parent
ff396155f2
commit
659a63a167
1 changed files with 6 additions and 0 deletions
|
|
@ -51,6 +51,8 @@ class MyClientSession(koji.ClientSession):
|
|||
class TestBuildNotification(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.original_timezone = os.environ.get('TZ')
|
||||
os.environ['TZ'] = 'US/Eastern'
|
||||
self.tempdir = tempfile.mkdtemp()
|
||||
self.SMTP = mock.patch('smtplib.SMTP').start()
|
||||
self.session = mock.MagicMock()
|
||||
|
|
@ -59,6 +61,10 @@ class TestBuildNotification(unittest.TestCase):
|
|||
self.options.workdir = self.tempdir
|
||||
|
||||
def tearDown(self):
|
||||
if self.original_timezone is None:
|
||||
del os.environ['TZ']
|
||||
else:
|
||||
os.environ['TZ'] = self.original_timezone
|
||||
mock.patch.stopall()
|
||||
|
||||
def test_build_notification(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue