diff options
author | Stephan Erb <steve-e@h3c.de> | 2009-11-12 01:38:17 +0300 |
---|---|---|
committer | Stephan Erb <steve-e@h3c.de> | 2009-11-12 01:38:17 +0300 |
commit | 641947719f8523021e0db40f4ea82915dfc3e866 (patch) | |
tree | f658a0de7bb1d4038ac939d00ee4f52465e52c83 /test/integration | |
parent | f457497bd1285cbe3d0d20645c20bd5d6718d46c (diff) | |
parent | 022003239d9e343f588195ecb53ec593f608c794 (diff) |
Merge changes from refactoring branch back to default
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/test_gui_event_integration.py | 11 | ||||
-rw-r--r-- | test/integration/test_roster.py | 20 |
2 files changed, 12 insertions, 19 deletions
diff --git a/test/integration/test_gui_event_integration.py b/test/integration/test_gui_event_integration.py index 00ed5c696..8759e2259 100644 --- a/test/integration/test_gui_event_integration.py +++ b/test/integration/test_gui_event_integration.py @@ -7,6 +7,7 @@ import lib lib.setup_env() from common import gajim +from common import contacts as contacts_module from gajim import Interface from gajim_mocks import * @@ -25,6 +26,9 @@ class TestStatusChange(unittest.TestCase): '''tests gajim.py's incredibly complex handle_event_notify''' def setUp(self): + + gajim.connections = {} + gajim.contacts = contacts_module.Contacts() gajim.interface.roster = roster_window.RosterWindow() for acc in contacts: @@ -38,13 +42,6 @@ class TestStatusChange(unittest.TestCase): self.assertEqual(0, len(notify.notifications)) def tearDown(self): - gajim.interface.roster.model.clear() - - for acc in contacts: - gajim.contacts.clear_contacts(acc) - - del gajim.interface.roster - notify.notifications = [] def contact_comes_online(self, account, jid, resource, prio): diff --git a/test/integration/test_roster.py b/test/integration/test_roster.py index 10d1ab488..acb91b71c 100644 --- a/test/integration/test_roster.py +++ b/test/integration/test_roster.py @@ -9,15 +9,16 @@ from mock import Mock, expectParams from gajim_mocks import * from common import gajim +from common import contacts as contacts_module import roster_window gajim.get_jid_from_account = lambda acc: 'myjid@' + acc + class TestRosterWindow(unittest.TestCase): def setUp(self): gajim.interface = MockInterface() - self.roster = roster_window.RosterWindow() self.C_NAME = roster_window.C_NAME self.C_TYPE = roster_window.C_TYPE @@ -26,13 +27,13 @@ class TestRosterWindow(unittest.TestCase): # Add after creating RosterWindow # We want to test the filling explicitly + gajim.contacts = contacts_module.Contacts() + gajim.connections = {} + self.roster = roster_window.RosterWindow() + for acc in contacts: gajim.connections[acc] = MockConnection(acc) - - def tearDown(self): - self.roster.model.clear() - for acc in gajim.contacts.get_accounts(): - gajim.contacts.clear_contacts(acc) + gajim.contacts.add_account(acc) ### Custom assertions def assert_all_contacts_are_in_roster(self, acc): @@ -142,11 +143,6 @@ class TestRosterWindow(unittest.TestCase): groups = contacts[acc][jid]['groups'] or ['General',] - # cleanup - self.roster.model.clear() - for acc in contacts: - gajim.contacts.clear_contacts(acc) - def test_fill_roster_model(self): for acc in contacts: self.roster.fill_contacts_and_groups_dicts(contacts[acc], acc) @@ -190,7 +186,7 @@ class TestRosterWindowMetaContacts(TestRosterWindowRegrouped): self.test_fill_roster_model() jid = u'coolstuff@gajim.org' - contact = gajim.contacts.create_contact(jid) + contact = gajim.contacts.create_contact(jid, account1) gajim.contacts.add_contact(account1, contact) self.roster.add_contact(jid, account1) self.roster.chg_contact_status(contact, 'offline', '', account1) |