aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Hoffstätte <holger@applied-asynchrony.com>2023-11-14 18:27:18 +0100
committerFlorian Schmaus <flow@gentoo.org>2023-11-14 19:01:15 +0100
commit1f31715a8a8be5718115886d88cf51843d0bf5dc (patch)
tree16890a2ca54aa1405520af2fd45b881c00506a15
parentcut release 2.3.2 (diff)
downloadjava-config-1f31715a8a8be5718115886d88cf51843d0bf5dc.tar.gz
java-config-1f31715a8a8be5718115886d88cf51843d0bf5dc.tar.bz2
java-config-1f31715a8a8be5718115886d88cf51843d0bf5dc.zip
update deprecated test methods for python-3.12 compatibility
Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com> Signed-off-by: Florian Schmaus <flow@gentoo.org>
-rw-r--r--tests/testsuite/EnvironmentManager.py2
-rw-r--r--tests/testsuite/VersionManager.py18
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/testsuite/EnvironmentManager.py b/tests/testsuite/EnvironmentManager.py
index 2dd863b..16a1fd2 100644
--- a/tests/testsuite/EnvironmentManager.py
+++ b/tests/testsuite/EnvironmentManager.py
@@ -11,7 +11,7 @@ class TestEnvironmentManager(unittest.TestCase):
def test_load_packages(self):
self.em.packages = {}
self.em.load_packages()
- self.assertEquals(len(self.em.get_packages()), 11)
+ self.assertEqual(len(self.em.get_packages()), 11)
def test_get_package(self):
self.em.get_package('ant-cores')
diff --git a/tests/testsuite/VersionManager.py b/tests/testsuite/VersionManager.py
index cc8a50b..7f11023 100644
--- a/tests/testsuite/VersionManager.py
+++ b/tests/testsuite/VersionManager.py
@@ -38,28 +38,28 @@ class TestVersionManager(unittest.TestCase):
def test_filter_depend_vanilla(self):
os.environ["USE"] = ""
- self.assertEquals(self.verman.filter_depend(self.example_dep_vanilla), self.example_dep_vanilla)
+ self.assertEqual(self.verman.filter_depend(self.example_dep_vanilla), self.example_dep_vanilla)
def test_filter_depend_or(self):
# Oh you only realise how ugly things are once you write unittests.
os.environ["USE"] = ""
rmatch = "|| =virtual/jdk-1.5 =virtual/jdk-1.4 dev-java/ant-core java-virtuals/jaf"
- self.assertEquals(self.verman.filter_depend(self.example_dep_or), rmatch)
+ self.assertEqual(self.verman.filter_depend(self.example_dep_or), rmatch)
def test_filter_depend_use_enabled(self):
os.environ["USE"] = "java"
rmatch = ">=virtual/jdk-1.5* dev-java/ant-core java-virtuals/jaf"
- self.assertEquals(self.verman.filter_depend(self.example_dep_use), rmatch)
+ self.assertEqual(self.verman.filter_depend(self.example_dep_use), rmatch)
def test_filter_depend_use_disabled(self):
os.environ["USE"] = ""
rmatch = "dev-java/ant-core java-virtuals/jaf"
- self.assertEquals(self.verman.filter_depend(self.example_dep_use), rmatch)
+ self.assertEqual(self.verman.filter_depend(self.example_dep_use), rmatch)
def test_filter_depend_use_unset(self):
del os.environ["USE"]
rmatch = self.example_dep_use
- self.assertEquals(self.verman.filter_depend(self.example_dep_use), rmatch)
+ self.assertEqual(self.verman.filter_depend(self.example_dep_use), rmatch)
def test_version_satisfies(self):
vm = self.em.get_vm('sun-jdk-1.6')
@@ -88,13 +88,13 @@ class TestVersionManager(unittest.TestCase):
def test_get_lowest(self):
target = self.verman.get_lowest(">=virtual/jdk-1.4")
- self.assertEquals(target, '1.4')
+ self.assertEqual(target, '1.4')
target = self.verman.get_lowest(self.example_dep_vanilla)
- self.assertEquals(target, '1.5')
+ self.assertEqual(target, '1.5')
target = self.verman.get_lowest(self.example_dep_or)
- self.assertEquals(target, '1.4')
+ self.assertEqual(target, '1.4')
def test_get_lowest_with_package_dep(self):
pass
@@ -108,7 +108,7 @@ class TestVersionManager(unittest.TestCase):
#def test_matches(self):
def test_version_cmp(self):
- self.assertEquals(self.verman.version_cmp('1.5.2', '1.5.2'), 0)
+ self.assertEqual(self.verman.version_cmp('1.5.2', '1.5.2'), 0)
self.assertTrue(self.verman.version_cmp('1.5', '1.5.1') < 0)
self.assertTrue(self.verman.version_cmp('1.5.1', '1.5') > 0)