From 58cb979a40362ed99dc7d32a1bc44f695ed76525 Mon Sep 17 00:00:00 2001 From: Caihui Date: Tue, 30 Jun 2020 04:49:23 -0700 Subject: [PATCH] Update "data" to bytes object The param "data" in f.write(data) should be bytes. Change-Id: Icbf9463c6f406df9cf25a8cf637b0173387582c5 --- freezer/tests/unit/scheduler/test_utils.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/freezer/tests/unit/scheduler/test_utils.py b/freezer/tests/unit/scheduler/test_utils.py index 6164774e..04266908 100644 --- a/freezer/tests/unit/scheduler/test_utils.py +++ b/freezer/tests/unit/scheduler/test_utils.py @@ -14,7 +14,6 @@ import os import shutil -import sys import tempfile import unittest from unittest import mock @@ -44,8 +43,6 @@ class TestUtils(unittest.TestCase): temp.close() self.assertFalse(os.path.exists(temp.name)) - # @unittest.skipIf(sys.version_info.major == 3, - # 'Not supported on python v 3.x') def test_find_config_files_path(self): temp = tempfile.NamedTemporaryFile('wb', delete=True, suffix='.conf') @@ -55,12 +52,10 @@ class TestUtils(unittest.TestCase): temp.close() self.assertFalse(os.path.exists(temp.name)) - @unittest.skipIf(sys.version_info.major == 3, - 'Not supported on python v 3.x') def test_get_jobs_from_disk(self): temp = tempfile.mkdtemp() file = '/'.join([temp, "test.conf"]) - data = '{"job_id": "test"}' + data = b'{"job_id": "test"}' with open(file, 'wb') as f: f.write(data) ret = utils.get_jobs_from_disk(temp)