1 2from PyObjCTools.TestSupport import * 3from SyncServices import * 4 5class TestISyncSession (TestCase): 6 @min_os_level('10.5') 7 def testMethods10_5(self): 8 self.assertArgIsSEL( 9 ISyncSession.beginSessionInBackgroundWithClient_entityNames_target_selector_, 3, b"v@:@@") 10 11 def testMethods(self): 12 self.assertResultIsBOOL(ISyncSession.shouldPushChangesForEntityName_) 13 self.assertResultIsBOOL(ISyncSession.shouldPushAllRecordsForEntityName_) 14 self.assertResultIsBOOL(ISyncSession.shouldPullChangesForEntityName_) 15 self.assertResultIsBOOL(ISyncSession.shouldReplaceAllRecordsOnClientForEntityName_) 16 17 self.assertArgIsBOOL(ISyncSession.clientLostRecordWithIdentifier_shouldReplaceOnNextSync_, 1) 18 self.assertResultIsBOOL(ISyncSession.prepareToPullChangesForEntityNames_beforeDate_) 19 self.assertArgIsSEL(ISyncSession.prepareToPullChangesInBackgroundForEntityNames_target_selector_, 2, b"v@:@@") 20 self.assertResultIsBOOL(ISyncSession.isCancelled) 21 22 def testConstants(self): 23 self.assertIsInstance(ISyncSessionCancelledException, unicode) 24 self.assertIsInstance(ISyncSessionUnavailableException, unicode) 25 self.assertIsInstance(ISyncInvalidRecordException, unicode) 26 self.assertIsInstance(ISyncInvalidRecordIdentifiersKey, unicode) 27 self.assertIsInstance(ISyncInvalidRecordReasonsKey, unicode) 28 self.assertIsInstance(ISyncInvalidRecordsKey, unicode) 29 self.assertIsInstance(ISyncInvalidEntityException, unicode) 30 self.assertIsInstance(ISyncUnsupportedEntityException, unicode) 31 self.assertIsInstance(ISyncRecordEntityNameKey, unicode) 32 33 34if __name__ == "__main__": 35 main() 36