Blob Blame History Raw
From dff4bce5d4cdc05d5013182766c9594f50776c1b Mon Sep 17 00:00:00 2001
From: Federico Pellegrin <fede@evolware.org>
Date: Tue, 13 Dec 2022 06:22:42 +0100
Subject: [PATCH] Replace deprecated assertEquals with equivalent assertEqual

Done already in upstream, but only on master, so backporting:
https://github.com/bottlepy/bottle/commit/f1d668b4c5a2657fa4786fe170d24829f511cad9
---
 test/test_config.py  | 8 ++++----
 test/test_environ.py | 4 ++--
 test/test_plugins.py | 2 +-
 test/test_stpl.py    | 2 +-
 test/test_wsgi.py    | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/test/test_config.py b/test/test_config.py
index ee9ec61..e8efaa0 100644
--- a/test/test_config.py
+++ b/test/test_config.py
@@ -29,16 +29,16 @@ class TestConfDict(unittest.TestCase):
         c['bool'] = 'I am so true!'
         c['int']  = '6'
         self.assertTrue(c['bool'] is True)
-        self.assertEquals(c['int'], 6)
+        self.assertEqual(c['int'], 6)
         self.assertRaises(ValueError, lambda: c.update(int='not an int'))
 
     def test_load_dict(self):
         c = ConfigDict()
         d = dict(a=dict(b=dict(foo=5, bar=6), baz=7))
         c.load_dict(d)
-        self.assertEquals(c['a.b.foo'], 5)
-        self.assertEquals(c['a.b.bar'], 6)
-        self.assertEquals(c['a.baz'], 7)
+        self.assertEqual(c['a.b.foo'], 5)
+        self.assertEqual(c['a.b.bar'], 6)
+        self.assertEqual(c['a.baz'], 7)
    
 if __name__ == '__main__': #pragma: no cover
     unittest.main()
diff --git a/test/test_environ.py b/test/test_environ.py
index de50c0b..40b605f 100755
--- a/test/test_environ.py
+++ b/test/test_environ.py
@@ -299,7 +299,7 @@ class TestRequest(unittest.TestCase):
         e['wsgi.input'].seek(0)
         e['HTTP_TRANSFER_ENCODING'] = 'chunked'
         if isinstance(expect, str):
-            self.assertEquals(tob(expect), BaseRequest(e).body.read())
+            self.assertEqual(tob(expect), BaseRequest(e).body.read())
         else:
             self.assertRaises(expect, lambda: BaseRequest(e).body)
 
@@ -578,7 +578,7 @@ class TestResponse(unittest.TestCase):
     def test_content_type(self):
         rs = BaseResponse()
         rs.content_type = 'test/some'
-        self.assertEquals('test/some', rs.headers.get('Content-Type'))
+        self.assertEqual('test/some', rs.headers.get('Content-Type'))
 
     def test_charset(self):
         rs = BaseResponse()
diff --git a/test/test_plugins.py b/test/test_plugins.py
index aec5042..f2da3f9 100644
--- a/test/test_plugins.py
+++ b/test/test_plugins.py
@@ -194,7 +194,7 @@ class TestPluginAPI(tools.ServerTestBase):
             def __call__(self, func): return func
             def setup(self, app): self.app = app
         plugin = self.app.install(Plugin())
-        self.assertEquals(getattr(plugin, 'app', None), self.app)
+        self.assertEqual(getattr(plugin, 'app', None), self.app)
 
     def test_close(self):
         class Plugin(object):
diff --git a/test/test_stpl.py b/test/test_stpl.py
index 32b53be..2c25ffb 100755
--- a/test/test_stpl.py
+++ b/test/test_stpl.py
@@ -54,7 +54,7 @@ class TestSimpleTemplate(unittest.TestCase):
         self.assertRenders('<{{var}}>', '<[1, 2]>', var=[1,2])
 
     def test_htmlutils_quote(self):
-        self.assertEquals('"&lt;&#039;&#13;&#10;&#9;&quot;\\&gt;"', html_quote('<\'\r\n\t"\\>'));
+        self.assertEqual('"&lt;&#039;&#13;&#10;&#9;&quot;\\&gt;"', html_quote('<\'\r\n\t"\\>'));
 
     def test_escape(self):
         self.assertRenders('<{{var}}>', '<b>', var='b')
diff --git a/test/test_wsgi.py b/test/test_wsgi.py
index 973ae8e..46ff332 100755
--- a/test/test_wsgi.py
+++ b/test/test_wsgi.py
@@ -257,7 +257,7 @@ class TestRouteDecorator(ServerTestBase):
     def test_name(self):
         @bottle.route(name='foo')
         def test(x=5): return 'ok'
-        self.assertEquals('/test/6', bottle.url('foo', x=6))
+        self.assertEqual('/test/6', bottle.url('foo', x=6))
 
     def test_callback(self):
         def test(x=5): return str(x)
-- 
2.38.1