[pygobject] [gi] fix actiongroup test since actions are hashed



commit ef74273c2043944708515e59a654ebe4944b46ff
Author: John (J5) Palmieri <johnp redhat com>
Date:   Thu Nov 18 13:54:48 2010 -0500

    [gi] fix actiongroup test since actions are hashed
    
    * when actions are listed they may not show up in the order they were entered
      since they reside in an unordered hash internally

 tests/test_overrides.py |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
index 79c7093..915155f 100644
--- a/tests/test_overrides.py
+++ b/tests/test_overrides.py
@@ -99,16 +99,17 @@ class TestGtk(unittest.TestCase):
             test_radio_action_callback_data,
             callback_data)
 
-        expected_results = (('test-action1', Gtk.Action),
+        expected_results = [('test-action1', Gtk.Action),
                             ('test-action2', Gtk.Action),
                             ('test-toggle-action1', Gtk.ToggleAction),
                             ('test-toggle-action2', Gtk.ToggleAction),
                             ('test-radio-action1', Gtk.RadioAction),
-                            ('test-radio-action2', Gtk.RadioAction))
+                            ('test-radio-action2', Gtk.RadioAction)]
 
-        for action, cmp in zip(action_group.list_actions(), expected_results):
+        for action in action_group.list_actions():
             a = (action.get_name(), type(action))
-            self.assertEquals(a,cmp)
+            self.assertTrue(a in expected_results)
+            expected_results.remove(a)
             action.activate()
 
     def test_builder(self):



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