class Hermes:
"""Encapsulate the process of syncing online friends' information with the
- Evolution contacts' database. This should be used as follows:
+ Evolution contacts' database.
- * Initialise, passing in a GUI callback.
- * Call Syncjob.
- * Retrieve information on changes effected.
- * Call update_contact to enact manual mapping.
-
Copyright (c) Andrew Flegg <andrew@bleb.org> 2010.
Released under the Artistic Licence."""
from org.maemo.hermes.gui.mapcontact import MapContact
from org.maemo.hermes.gui.accountsdialogue import AccountsDialogue
from org.bleb.wimpworks import HildonMainScreenLayout
-from org.maemo.hermes.engine.syncjob import SyncJob
from org.maemo.hermes.engine.hermes import Hermes
class HermesGUI(WimpWorks):
+++ /dev/null
-import unittest
-from org.maemo.hermes.engine.syncjob import SyncJob
-
-class FakeContact():
- def __init__(self):
- pass
-
-class FakeService():
- def __init__(self):
- self.contacts_preprocessed = []
- self.contacts_processed = []
- def get_name(self):
- return "fake service"
- def pre_process_contact(self, contact):
- self.contacts_preprocessed.append(contact)
- def process_friends(self):
- pass
- def process_contact(self, contact):
- self.contacts_processed.append(contact)
-
-
-class TestSyncJob(unittest.TestCase):
-
- def setUp(self):
- self.service = FakeService()
- self.services = [self.service]
- self.contact = FakeContact()
- self.contacts = [self.contact]
- self.testee = SyncJob(self.services, self.contacts)
-
- def test_main_flow(self):
- self.testee.run()
- assert self.contact in self.service.contacts_preprocessed
- assert self.contact in self.service.contacts_processed
-
-if __name__ == '__main__':
- unittest.main()