It may be good to set home directory every time like this:
````
  // set home directory
    pgp.homeDirectory = [tmpDir stringByAppendingPathComponent:@"home"];
    [fm createDirectoryAtPath:pgp.homeDirectory withIntermediateDirectories:YES attributes:nil error:&error];
    if (![fm fileExistsAtPath:pgp.homeDirectory] || error) {
        XCTFail(@"couldn't create home directory: %@", error.localizedDescription);
    }
````