Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove deprecated assertEquals use
  • Loading branch information
nyalldawson committed Apr 25, 2017
1 parent 997b630 commit 6b260ff
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions python/plugins/processing/tests/ParametersTest.py
Expand Up @@ -78,8 +78,8 @@ def testScriptCode(self):
if hasattr(param, 'getAsScriptCode'):
code = param.getAsScriptCode()
importedParam = paramClass.fromScriptCode(code)
self.assertEquals(param.optional, importedParam.optional)
self.assertEquals(param.default, importedParam.default, param)
self.assertEqual(param.optional, importedParam.optional)
self.assertEqual(param.default, importedParam.default, param)


class ParameterBooleanTest(unittest.TestCase):
Expand Down Expand Up @@ -651,7 +651,7 @@ def testScriptCode(self):
result = getParameterFromString(code)
self.assertIsInstance(result, ParameterExpression)
self.assertTrue(result.optional)
self.assertEquals(result.default, parameter.default)
self.assertEqual(result.default, parameter.default)


class ParameterTableFieldTest(unittest.TestCase):
Expand Down
12 changes: 6 additions & 6 deletions tests/src/python/test_qgsactionmanager.py
Expand Up @@ -141,8 +141,8 @@ def testDefaultAction(self):
# set good default action
self.manager.setDefaultAction('Feature', action1.id())
self.assertTrue(self.manager.defaultAction('Feature').isValid())
self.assertEquals(self.manager.defaultAction('Feature').id(), action1.id())
self.assertNotEquals(self.manager.defaultAction('Feature').id(), action2.id())
self.assertEqual(self.manager.defaultAction('Feature').id(), action1.id())
self.assertNotEqual(self.manager.defaultAction('Feature').id(), action2.id())

# if default action is removed, should be reset to -1
self.manager.clearActions()
Expand Down Expand Up @@ -174,26 +174,26 @@ def testDoAction(self):
self.manager.doAction(id1, f, c)
time.sleep(0.5)

self.assertEquals(self.check_action_result(temp_file), 'test output')
self.assertEqual(self.check_action_result(temp_file), 'test output')

# action with substitutions
temp_file = self.get_temp_filename()
id2 = self.manager.addAction(QgsAction.Unix, 'test_action', self.create_action(temp_file, 'test [% $id %] output [% @layer_name %]'))
self.manager.doAction(id2, f, c)
time.sleep(0.5)

self.assertEquals(self.check_action_result(temp_file), 'test 1 output test_layer')
self.assertEqual(self.check_action_result(temp_file), 'test 1 output test_layer')

# test doAction using field variant
temp_file = self.get_temp_filename()
id3 = self.manager.addAction(QgsAction.Unix, 'test_action',
self.create_action(temp_file, 'test : [% @field_index %] : [% @field_name %] : [% @field_value%]'))
self.manager.doActionFeature(id3, f, 0)
time.sleep(0.5)
self.assertEquals(self.check_action_result(temp_file), 'test : 0 : my_field : 5')
self.assertEqual(self.check_action_result(temp_file), 'test : 0 : my_field : 5')
self.manager.doActionFeature(id3, f, 1)
time.sleep(0.5)
self.assertEquals(self.check_action_result(temp_file), 'test : 1 : my_other_field : val')
self.assertEqual(self.check_action_result(temp_file), 'test : 1 : my_other_field : val')


if __name__ == '__main__':
Expand Down
12 changes: 6 additions & 6 deletions tests/src/python/test_qgsxmlutils.py
Expand Up @@ -36,7 +36,7 @@ def test_integer(self):
elem = QgsXmlUtils.writeVariant(my_properties, doc)

prop2 = QgsXmlUtils.readVariant(elem)
self.assertEquals(my_properties, prop2)
self.assertEqual(my_properties, prop2)

def test_string(self):
"""
Expand All @@ -49,7 +49,7 @@ def test_string(self):

prop2 = QgsXmlUtils.readVariant(elem)

self.assertEquals(my_properties, prop2)
self.assertEqual(my_properties, prop2)

def test_double(self):
"""
Expand All @@ -62,7 +62,7 @@ def test_double(self):

prop2 = QgsXmlUtils.readVariant(elem)

self.assertEquals(my_properties, prop2)
self.assertEqual(my_properties, prop2)

def test_boolean(self):
"""
Expand All @@ -75,7 +75,7 @@ def test_boolean(self):

prop2 = QgsXmlUtils.readVariant(elem)

self.assertEquals(my_properties, prop2)
self.assertEqual(my_properties, prop2)

def test_list(self):
"""
Expand All @@ -87,7 +87,7 @@ def test_list(self):

prop2 = QgsXmlUtils.readVariant(elem)

self.assertEquals(my_properties, prop2)
self.assertEqual(my_properties, prop2)

def test_complex(self):
"""
Expand All @@ -100,7 +100,7 @@ def test_complex(self):

prop2 = QgsXmlUtils.readVariant(elem)

self.assertEquals(my_properties, prop2)
self.assertEqual(my_properties, prop2)


if __name__ == '__main__':
Expand Down

0 comments on commit 6b260ff

Please sign in to comment.