pEpObjCTests/PEPSessionTest.m
changeset 470 3d39b8fc939d
parent 465 c119e90af091
child 471 b19faa4c131f
     1.1 --- a/pEpObjCTests/PEPSessionTest.m	Mon Feb 19 10:07:10 2018 +0100
     1.2 +++ b/pEpObjCTests/PEPSessionTest.m	Mon Feb 19 10:30:59 2018 +0100
     1.3 @@ -564,49 +564,6 @@
     1.4      [self pEpCleanUp];
     1.5  }
     1.6  
     1.7 -- (void)testRenewExpired
     1.8 -{
     1.9 -    PEPSession *session = [PEPSession new];
    1.10 -
    1.11 -    // Our expired test user :
    1.12 -    // pEp Test Hector (old test key don't use) <pep.test.hector@pep-project.org>
    1.13 -    [PEPTestUtils importBundledKey:@"5CB2C182_sec.asc"];
    1.14 -
    1.15 -    PEPIdentity *identHector = [[PEPIdentity alloc]
    1.16 -                                initWithAddress:@"pep.test.hector@pep-project.org"
    1.17 -                                userID:@"fc2d33" userName:@"pEp Test Hector"
    1.18 -                                isOwn:NO
    1.19 -                                fingerPrint:@"EEA655839E347EC9E10A5DE2E80CB3FD5CB2C182"];
    1.20 -
    1.21 -    // Check that this key is indeed expired
    1.22 -    [session updateIdentity:identHector];
    1.23 -    XCTAssertEqual(PEP_ct_key_expired, identHector.commType);
    1.24 -
    1.25 -    PEPIdentity *identHectorOwn = [[PEPIdentity alloc]
    1.26 -                                   initWithAddress:@"pep.test.hector@pep-project.org"
    1.27 -                                   userID:ownUserId userName:@"pEp Test Hector"
    1.28 -                                   isOwn:YES
    1.29 -                                   fingerPrint:@"EEA655839E347EC9E10A5DE2E80CB3FD5CB2C182"];
    1.30 -
    1.31 -    // Myself automatically renew expired key.
    1.32 -    [session mySelf:identHectorOwn];
    1.33 -    XCTAssertEqual(PEP_ct_pEp, identHectorOwn.commType);
    1.34 -
    1.35 -    [self pEpCleanUpRestoringBackupNamed:@"Bob"];
    1.36 -
    1.37 -
    1.38 -    [self pEpSetUp:@"Bob"];
    1.39 -
    1.40 -    PEPIdentity *_identHector = [[PEPIdentity alloc]
    1.41 -                                 initWithAddress:@"pep.test.hector@pep-project.org"
    1.42 -                                 userID:@"khkhkh" userName:@"pEp Test Hector"
    1.43 -                                 isOwn:NO
    1.44 -                                 fingerPrint:@"EEA655839E347EC9E10A5DE2E80CB3FD5CB2C182"];
    1.45 -
    1.46 -    [session updateIdentity:_identHector];
    1.47 -    XCTAssertEqual(PEP_ct_OpenPGP_unconfirmed, _identHector.commType);
    1.48 -}
    1.49 -
    1.50  - (void)testRevoke
    1.51  {
    1.52      PEPSession *session = [PEPSession new];
    1.53 @@ -633,7 +590,6 @@
    1.54      identAlice2.fingerPrint = nil;
    1.55      [session mySelf:identAlice];
    1.56  
    1.57 -
    1.58      // Check fingerprint is different
    1.59      XCTAssertNotEqualObjects(identAlice2.fingerPrint, fpr);
    1.60  }
    1.61 @@ -1113,29 +1069,13 @@
    1.62      return unencDict;
    1.63  }
    1.64  
    1.65 -- (void)pEpCleanUpRestoringBackupNamed:(NSString *)backup {
    1.66 -    [PEPTestUtils deleteWorkFilesAfterBackingUpWithBackupName:backup];
    1.67 -}
    1.68 -
    1.69  - (void)pEpCleanUp
    1.70  {
    1.71 -    [PEPSession cleanup];
    1.72 -    [self pEpCleanUpRestoringBackupNamed:NULL];
    1.73 -}
    1.74 -
    1.75 -- (void)pEpSetUp:(NSString *)restore
    1.76 -{
    1.77 -    // Must be the first thing you do before using anything pEp-related
    1.78 -    // ... but this is now done in session, with a "dispatch_once"
    1.79 -    // [PEPObjCAdapter setupTrustWordsDB:[NSBundle bundleForClass:[self class]]];
    1.80 -
    1.81 -    [PEPTestUtils deleteWorkFilesAfterBackingUpWithBackupName:nil];
    1.82 -    [PEPTestUtils restoreWorkFilesFromBackupNamed:restore];
    1.83 +    [PEPTestUtils cleanUp];
    1.84  }
    1.85  
    1.86  - (void)pEpSetUp
    1.87  {
    1.88 -    [self pEpSetUp:NULL];
    1.89  }
    1.90  
    1.91  - (void)helperXEncStatusForOutgoingEncryptdMailToSelf:(BOOL)toSelf