Skip to content

Commit

Permalink
Testing: Move from deprecated assertEquals to assertEqual (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
frantisekz authored Jul 29, 2023
1 parent 0b74401 commit dbabb27
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/core/helper_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def test_try_match(self):
self.assertTrue(try_match('www.com/foo', 'www.com/fo*'))

def test_flexible_str_str(self):
self.assertEquals(flexible_str('Bar, Foo, Qux'), 'Bar, Foo, Qux')
self.assertEqual(flexible_str('Bar, Foo, Qux'), 'Bar, Foo, Qux')

def test_flexible_str_set(self):
self.assertEquals(flexible_str({'Foo', 'Bar', 'Qux'}),
self.assertEqual(flexible_str({'Foo', 'Bar', 'Qux'}),
'Bar, Foo, Qux')

def test_serialize_options(self):
Expand All @@ -43,24 +43,24 @@ def test_serialize_options(self):
def test_get_allow_headers_empty(self):
options = serialize_options({'allow_headers': r'*'})

self.assertEquals(get_allow_headers(options, ''), None)
self.assertEquals(get_allow_headers(options, None), None)
self.assertEqual(get_allow_headers(options, ''), None)
self.assertEqual(get_allow_headers(options, None), None)

def test_get_allow_headers_matching(self):
options = serialize_options({'allow_headers': r'*'})

self.assertEquals(get_allow_headers(options, 'X-FOO'), 'X-FOO')
self.assertEquals(
self.assertEqual(get_allow_headers(options, 'X-FOO'), 'X-FOO')
self.assertEqual(
get_allow_headers(options, 'X-Foo, X-Bar'),
'X-Bar, X-Foo'
)

def test_get_allow_headers_matching_none(self):
options = serialize_options({'allow_headers': r'X-FLASK-.*'})

self.assertEquals(get_allow_headers(options, 'X-FLASK-CORS'),
self.assertEqual(get_allow_headers(options, 'X-FLASK-CORS'),
'X-FLASK-CORS')
self.assertEquals(
self.assertEqual(
get_allow_headers(options, 'X-NOT-FLASK-CORS'),
''
)
Expand Down

0 comments on commit dbabb27

Please sign in to comment.