代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/apparmor 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 2e2529bae81b0858d5f25c3d6f886fa3eba3f502 Mon Sep 17 00:00:00 2001
From: Christian Boltz <[email protected]>
Date: Tue, 26 Feb 2019 21:27:00 +0100
Subject: [PATCH] Replace deprecated assertEquals with assertEqual
assertEquals is deprecated since Python 2.7 and 3.2.
(cherry picked from commit 62abfe38e8bb3e6ba4dc873efbd1855888ea8aa0)
Signed-off-by: John Johansen <[email protected]>
---
.../swig/python/test/test_python.py.in | 4 ++--
parser/tst/caching.py | 24 +++++++++----------
utils/test/test-aa-easyprof.py | 4 ++--
3 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/libraries/libapparmor/swig/python/test/test_python.py.in b/libraries/libapparmor/swig/python/test/test_python.py.in
index 37849554..75c71415 100644
--- a/libraries/libapparmor/swig/python/test/test_python.py.in
+++ b/libraries/libapparmor/swig/python/test/test_python.py.in
@@ -74,7 +74,7 @@ class AAPythonBindingsTests(unittest.TestCase):
libapparmor.free_record(swig_record)
expected = self.parse_output_file(outfile)
- self.assertEquals(expected, record,
+ self.assertEqual(expected, record,
"expected records did not match\n" +
"expected = %s\nactual = %s" % (expected, record))
@@ -90,7 +90,7 @@ class AAPythonBindingsTests(unittest.TestCase):
line = l.rstrip('\n')
count += 1
if line == "START":
- self.assertEquals(count, 1,
+ self.assertEqual(count, 1,
"Unexpected output format in %s" % (outfile))
continue
else:
diff --git a/parser/tst/caching.py b/parser/tst/caching.py
index 6d07b696..ad8a1be0 100755
--- a/parser/tst/caching.py
+++ b/parser/tst/caching.py
@@ -137,7 +137,7 @@ class AAParserCachingCommon(testlib.AATestTemplate):
with open(features_path) as f:
features = f.read()
if expected:
- self.assertEquals(expected_output, features,
+ self.assertEqual(expected_output, features,
"features contents differ, expected:\n%s\nresult:\n%s" % (expected_output, features))
else:
self.assertNotEquals(expected_output, features,
@@ -269,7 +269,7 @@ class AAParserCachingTests(AAParserCachingCommon):
if (int(major) < 3) or ((int(major) == 3) and (int(minor) <= 2)):
self.assertAlmostEquals(time1, time2, places=5)
else:
- self.assertEquals(time1, time2)
+ self.assertEqual(time1, time2)
def _set_mtime(self, path, mtime):
atime = os.stat(path).st_atime
@@ -370,7 +370,7 @@ class AAParserCachingTests(AAParserCachingCommon):
# in cache_contents because of the difficulty coercing cache
# file bytes into strings in python3
self.assertNotEquals(orig_stat.st_size, stat.st_size, 'Expected cache file to be updated, size is not changed.')
- self.assertEquals(os.stat(self.profile).st_mtime, stat.st_mtime)
+ self.assertEqual(os.stat(self.profile).st_mtime, stat.st_mtime)
def test_cache_writing_clears_all_files(self):
'''test cache writing clears all cache files'''
@@ -388,7 +388,7 @@ class AAParserCachingTests(AAParserCachingCommon):
self._set_mtime(self.abstraction, 0)
self._set_mtime(self.profile, expected)
self._generate_cache_file()
- self.assertEquals(expected, os.stat(self.cache_file).st_mtime)
+ self.assertEqual(expected, os.stat(self.cache_file).st_mtime)
def test_abstraction_mtime_preserved(self):
'''test abstraction mtime is preserved when it is newest'''
@@ -396,7 +396,7 @@ class AAParserCachingTests(AAParserCachingCommon):
self._set_mtime(self.profile, 0)
self._set_mtime(self.abstraction, expected)
self._generate_cache_file()
- self.assertEquals(expected, os.stat(self.cache_file).st_mtime)
+ self.assertEqual(expected, os.stat(self.cache_file).st_mtime)
def test_equal_mtimes_preserved(self):
'''test equal profile and abstraction mtimes are preserved'''
@@ -404,7 +404,7 @@ class AAParserCachingTests(AAParserCachingCommon):
self._set_mtime(self.profile, expected)
self._set_mtime(self.abstraction, expected)
self._generate_cache_file()
- self.assertEquals(expected, os.stat(self.cache_file).st_mtime)
+ self.assertEqual(expected, os.stat(self.cache_file).st_mtime)
def test_profile_newer_skips_cache(self):
'''test cache is skipped if profile is newer'''
@@ -420,9 +420,9 @@ class AAParserCachingTests(AAParserCachingCommon):
self.run_cmd_check(cmd, expected_string='Replacement succeeded for')
stat = os.stat(self.cache_file)
- self.assertEquals(orig_stat.st_size, stat.st_size)
- self.assertEquals(orig_stat.st_ino, stat.st_ino)
- self.assertEquals(orig_stat.st_mtime, stat.st_mtime)
+ self.assertEqual(orig_stat.st_size, stat.st_size)
+ self.assertEqual(orig_stat.st_ino, stat.st_ino)
+ self.assertEqual(orig_stat.st_mtime, stat.st_mtime)
def test_abstraction_newer_skips_cache(self):
'''test cache is skipped if abstraction is newer'''
@@ -438,9 +438,9 @@ class AAParserCachingTests(AAParserCachingCommon):
self.run_cmd_check(cmd, expected_string='Replacement succeeded for')
stat = os.stat(self.cache_file)
- self.assertEquals(orig_stat.st_size, stat.st_size)
- self.assertEquals(orig_stat.st_ino, stat.st_ino)
- self.assertEquals(orig_stat.st_mtime, stat.st_mtime)
+ self.assertEqual(orig_stat.st_size, stat.st_size)
+ self.assertEqual(orig_stat.st_ino, stat.st_ino)
+ self.assertEqual(orig_stat.st_mtime, stat.st_mtime)
def test_profile_newer_rewrites_cache(self):
'''test cache is rewritten if profile is newer'''
diff --git a/utils/test/test-aa-easyprof.py b/utils/test/test-aa-easyprof.py
index ba468f3e..d2057972 100755
--- a/utils/test/test-aa-easyprof.py
+++ b/utils/test/test-aa-easyprof.py
@@ -1674,7 +1674,7 @@ POLICYGROUPS_DIR="%s/templates"
# verify we get the same manifest back
man_new = easyp.gen_manifest(params)
- self.assertEquals(m, man_new)
+ self.assertEqual(m, man_new)
def test_gen_manifest_ubuntu(self):
'''Test gen_manifest (ubuntu)'''
@@ -1714,7 +1714,7 @@ POLICYGROUPS_DIR="%s/templates"
# verify we get the same manifest back
man_new = easyp.gen_manifest(params)
- self.assertEquals(m, man_new)
+ self.assertEqual(m, man_new)
def test_parse_manifest_no_version(self):
'''Test parse_manifest (vendor with no version)'''
--
2.37.3.windows.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。