diff options
author | Dime Mikhalchenko <mixal4enko@gmail.com> | 2018-06-11 01:56:25 +0300 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2018-07-19 12:43:59 +0200 |
commit | dd55a1375b96503c94a2644e62665b327473bf95 (patch) | |
tree | 8b5ede36a127cb30d372cdf480b8a5a5d69c568b | |
parent | 1de24157e74a6971d136550afe1b63eec5b0df2b (diff) | |
download | bottle-dd55a1375b96503c94a2644e62665b327473bf95.tar.gz |
fix deprecation warnings (assertEquals); make tests environ and jinja2 runnable standalone
-rw-r--r-- | test/test_app.py | 4 | ||||
-rw-r--r-- | test/test_config.py | 4 | ||||
-rwxr-xr-x | test/test_environ.py | 6 | ||||
-rw-r--r-- | test/test_html_helper.py | 2 | ||||
-rw-r--r-- | test/test_jinja2.py | 3 |
5 files changed, 9 insertions, 10 deletions
diff --git a/test/test_app.py b/test/test_app.py index bc4acc5..a4fc748 100644 --- a/test/test_app.py +++ b/test/test_app.py @@ -13,8 +13,8 @@ class TestApplicationObject(unittest.TestCase): """ Attributed can be assigned, but only once. """ app = Bottle() app.test = 5 - self.assertEquals(5, app.test) + self.assertEqual(5, app.test) self.assertRaises(AttributeError, setattr, app, 'test', 6) del app.test app.test = 6 - self.assertEquals(6, app.test) + self.assertEqual(6, app.test) diff --git a/test/test_config.py b/test/test_config.py index 6d7aa50..96b6e95 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -28,8 +28,8 @@ class TestConfDict(unittest.TestCase): self.assertEqual('key' in d, 'key' in m) self.assertEqual('cay' in d, 'cay' in m) self.assertRaises(KeyError, lambda: m['cay']) - self.assertEquals(d.setdefault('key', "Val2"), m.setdefault('key', "Val2")) - self.assertEquals(d.setdefault('key', "Val3"), m.setdefault('key', "Val3")) + self.assertEqual(d.setdefault('key', "Val2"), m.setdefault('key', "Val2")) + self.assertEqual(d.setdefault('key', "Val3"), m.setdefault('key', "Val3")) self.assertEqual(d.get('key'), m.get('key')) with self.assertRaises(KeyError): del m['No key'] diff --git a/test/test_environ.py b/test/test_environ.py index 6a49e5d..e46b487 100755 --- a/test/test_environ.py +++ b/test/test_environ.py @@ -8,7 +8,7 @@ import itertools import bottle from bottle import request, tob, touni, tonat, json_dumps, HTTPError, parse_date -from test import tools +import tools import wsgiref.util import base64 @@ -489,14 +489,14 @@ class TestResponse(unittest.TestCase): from functools import partial make_res = partial(BaseResponse, '', 200) - self.assertEquals('yay', make_res(x_test='yay')['x-test']) + self.assertEqual('yay', make_res(x_test='yay')['x-test']) def test_wsgi_header_values(self): def cmp(app, wire): rs = BaseResponse() rs.set_header('x-test', app) result = [v for (h, v) in rs.headerlist if h.lower()=='x-test'][0] - self.assertEquals(wire, result) + self.assertEqual(wire, result) if bottle.py3k: cmp(1, tonat('1', 'latin1')) diff --git a/test/test_html_helper.py b/test/test_html_helper.py index e4a6df5..3f8619b 100644 --- a/test/test_html_helper.py +++ b/test/test_html_helper.py @@ -8,7 +8,7 @@ class TestHttpUtils(unittest.TestCase): # TODO: Move more of the low level http stuff here. def test_accept_header(self): - self.assertEquals(_parse_http_header( + self.assertEqual(_parse_http_header( 'text/xml, text/whitespace ,' 'application/params;param=value; ws = lots ;"quote"="mid\\"quote",' '"more\\"quotes\\"",' diff --git a/test/test_jinja2.py b/test/test_jinja2.py index b19dabc..dfac9bd 100644 --- a/test/test_jinja2.py +++ b/test/test_jinja2.py @@ -1,9 +1,8 @@ # -*- coding: utf-8 -*- import unittest from bottle import Jinja2Template, jinja2_template, jinja2_view, touni -from tools import warn +from tools import warn, chdir -from test.tools import chdir class TestJinja2Template(unittest.TestCase): |