Ben Copsey

Remove new test (it seems to be a duplicate of the fileDownload test)

Remove tests from fileDownload test that we can't use anymore (because temporaryFileDownloadPath will be nil when a request has completed)
... ... @@ -40,5 +40,4 @@
- (void)testThrottlingDownloadBandwidth;
- (void)testThrottlingUploadBandwidth;
- (void)testMainThreadDelegateAuthenticationFailure;
- (void)testFileCleanupWorks;
@end
... ...
... ... @@ -222,13 +222,7 @@
ASIHTTPRequest *request = [[[ASIHTTPRequest alloc] initWithURL:url] autorelease];
[request setDownloadDestinationPath:path];
[request start];
NSString *tempPath = [request temporaryFileDownloadPath];
GHAssertNotNil(tempPath,@"Failed to download file to temporary location");
BOOL success = (![[NSFileManager defaultManager] fileExistsAtPath:tempPath]);
GHAssertTrue(success,@"Failed to remove file from temporary location");
#if TARGET_OS_IPHONE
UIImage *image = [[[UIImage alloc] initWithContentsOfFile:path] autorelease];
#else
... ... @@ -238,6 +232,7 @@
GHAssertNotNil(image,@"Failed to download data to a file");
}
- (void)testCompressedResponseDownloadToFile
{
NSString *path = [[self filePathForTemporaryTestFiles] stringByAppendingPathComponent:@"testfile"];
... ... @@ -899,25 +894,6 @@
}
- (void)handleDownloadFailed:(ASIHTTPRequest *)request
{
GHFail(@"Download failed for file cleanup test");
}
// Test for a bug that existed that would attempt to remove the temporary download file twice
- (void)testFileCleanupWorks
{
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/i/logo.png"]];
NSString *path = [[self filePathForTemporaryTestFiles] stringByAppendingPathComponent:@"test.png"];
if ([[NSFileManager defaultManager] fileExistsAtPath:path]) {
[[NSFileManager defaultManager] removeItemAtPath:path error:nil];
}
[request setDownloadDestinationPath:path];
[request setDelegate:self];
[request setDidFailSelector:@selector(handleDownloadFailed:)];
[request start];
}
@end
... ...