Commit 1c5634e6 authored by Martin Pitt's avatar Martin Pitt
Browse files

tests: Fix deprecated assertions

assertAlmostEquals → assertAlmostEqual
assertNotEquals → assertNotEqual
parent 07f312e6
......@@ -499,12 +499,12 @@ class TestProperties(unittest.TestCase):
self.assertEqual(object_.props.float, 0.0)
object_.props.float = 42.42
self.assertTrue(isinstance(object_.props.float, float))
self.assertAlmostEquals(object_.props.float, 42.42, places=5)
self.assertAlmostEqual(object_.props.float, 42.42, places=5)
self.assertEqual(object_.props.double, 0.0)
object_.props.double = 42.42
self.assertTrue(isinstance(object_.props.double, float))
self.assertAlmostEquals(object_.props.double, 42.42, places=5)
self.assertAlmostEqual(object_.props.double, 42.42, places=5)
self.assertEqual(object_.props.string, None)
object_.props.string = 'mec'
......
......@@ -562,7 +562,7 @@ class TestFloat(unittest.TestCase):
MIN = GObject.constants.G_MINFLOAT
def test_float_return(self):
self.assertAlmostEquals(self.MAX, GIMarshallingTests.float_return())
self.assertAlmostEqual(self.MAX, GIMarshallingTests.float_return())
def test_float_in(self):
GIMarshallingTests.float_in(Number(self.MAX))
......@@ -570,10 +570,10 @@ class TestFloat(unittest.TestCase):
self.assertRaises(TypeError, GIMarshallingTests.float_in, "self.MAX")
def test_float_out(self):
self.assertAlmostEquals(self.MAX, GIMarshallingTests.float_out())
self.assertAlmostEqual(self.MAX, GIMarshallingTests.float_out())
def test_float_inout(self):
self.assertAlmostEquals(self.MIN, GIMarshallingTests.float_inout(Number(self.MAX)))
self.assertAlmostEqual(self.MIN, GIMarshallingTests.float_inout(Number(self.MAX)))
class TestDouble(unittest.TestCase):
......@@ -582,7 +582,7 @@ class TestDouble(unittest.TestCase):
MIN = GObject.constants.G_MINDOUBLE
def test_double_return(self):
self.assertAlmostEquals(self.MAX, GIMarshallingTests.double_return())
self.assertAlmostEqual(self.MAX, GIMarshallingTests.double_return())
def test_double_in(self):
GIMarshallingTests.double_in(Number(self.MAX))
......@@ -590,10 +590,10 @@ class TestDouble(unittest.TestCase):
self.assertRaises(TypeError, GIMarshallingTests.double_in, "self.MAX")
def test_double_out(self):
self.assertAlmostEquals(self.MAX, GIMarshallingTests.double_out())
self.assertAlmostEqual(self.MAX, GIMarshallingTests.double_out())
def test_double_inout(self):
self.assertAlmostEquals(self.MIN, GIMarshallingTests.double_inout(Number(self.MAX)))
self.assertAlmostEqual(self.MIN, GIMarshallingTests.double_inout(Number(self.MAX)))
class TestGType(unittest.TestCase):
......
......@@ -499,13 +499,13 @@ class TestGdk(unittest.TestCase):
self.assertEqual(color.green, 200)
self.assertEqual(color.blue, 300)
self.assertEqual(color, Gdk.Color(100, 200, 300))
self.assertNotEquals(color, Gdk.Color(1, 2, 3))
self.assertNotEqual(color, Gdk.Color(1, 2, 3))
def test_rgba(self):
self.assertEqual(Gdk.RGBA, overrides.Gdk.RGBA)
rgba = Gdk.RGBA(0.1, 0.2, 0.3, 0.4)
self.assertEqual(rgba, Gdk.RGBA(0.1, 0.2, 0.3, 0.4))
self.assertNotEquals(rgba, Gdk.RGBA(0.0, 0.2, 0.3, 0.4))
self.assertNotEqual(rgba, Gdk.RGBA(0.0, 0.2, 0.3, 0.4))
self.assertEqual(rgba.red, 0.1)
self.assertEqual(rgba.green, 0.2)
self.assertEqual(rgba.blue, 0.3)
......@@ -1374,7 +1374,7 @@ class TestGtk(unittest.TestCase):
for i in range(100):
label = 'this is row #%d' % i
parent = tree_store.append(None, (DerivedIntType(i), DerivedStrType(label),))
self.assertNotEquals(parent, None)
self.assertNotEqual(parent, None)
for j in range(20):
label = 'this is child #%d of node #%d' % (j, i)
child = tree_store.append(parent, (j, label,))
......@@ -1866,8 +1866,8 @@ class TestGtk(unittest.TestCase):
hscrollbar = Gtk.HScrollbar()
vscrollbar = Gtk.VScrollbar()
self.assertNotEquals(hscrollbar.props.adjustment, adjustment)
self.assertNotEquals(vscrollbar.props.adjustment, adjustment)
self.assertNotEqual(hscrollbar.props.adjustment, adjustment)
self.assertNotEqual(vscrollbar.props.adjustment, adjustment)
hscrollbar = Gtk.HScrollbar(adjustment)
vscrollbar = Gtk.VScrollbar(adjustment)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment