[pygobject] tests: Fix deprecated assertions



commit 1c5634e6d98c8b67b37a2747951c66f5d8f1907d
Author: Martin Pitt <martinpitt gnome org>
Date:   Thu May 3 09:28:51 2012 +0200

    tests: Fix deprecated assertions
    
    assertAlmostEquals â assertAlmostEqual
    assertNotEquals â assertNotEqual

 tests/test_everything.py |    4 ++--
 tests/test_gi.py         |   12 ++++++------
 tests/test_overrides.py  |   10 +++++-----
 3 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/tests/test_everything.py b/tests/test_everything.py
index 563936b..47408d4 100644
--- a/tests/test_everything.py
+++ b/tests/test_everything.py
@@ -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'
diff --git a/tests/test_gi.py b/tests/test_gi.py
index 2b5b5a1..6245b4a 100644
--- a/tests/test_gi.py
+++ b/tests/test_gi.py
@@ -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):
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
index aef20e8..4f1e5c9 100644
--- a/tests/test_overrides.py
+++ b/tests/test_overrides.py
@@ -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)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]