<commit_before>
@implementation CPURLConnectionTest : OJTestCase
{
}

- (void)testParseHTTPHeaders
{
    var testHeader = "Server: gunicorn/0.17.1\r\nDate: Fri, 11 Jan 2013 10:32:43 GMT\r\nConnection: close\r\nTransfer-Encoding: chunked\r\nVary: Accept, Cookie\r\nContent-Type: application/json; charset=utf-8\r\nCache-Control: no-cache\r\n",
        parsed = [CPHTTPURLResponse parseHTTPHeaders:testHeader];

    [self assert:@"gunicorn/0.17.1" equals:[parsed valueForKey:@"Server"]];
    [self assert:@"Fri, 11 Jan 2013 10:32:43 GMT" equals:[parsed valueForKey:@"Date"]];
    [self assert:@"close" equals:[parsed valueForKey:@"Connection"]];
    [self assert:@"chunked" equals:[parsed valueForKey:@"Transfer-Encoding"]];
    [self assert:@"Accept, Cookie" equals:[parsed valueForKey:@"Vary"]];
    [self assert:@"application/json; charset=utf-8" equals:[parsed valueForKey:@"Content-Type"]];
    [self assert:@"no-cache" equals:[parsed valueForKey:@"Cache-Control"]];
    [self assert:7 equals:[[parsed allKeys] count]];
}

- (void)testSynchronousRequestSuccess
{
    var req = [CPURLRequest requestWithURL:@"Tests/Foundation/CPURLConnectionTest.j"],    
        data = [CPURLConnection sendSynchronousRequest:req returningResponse:nil];

    [self assert:CPData equals:[data class]];
    [self assertNotNull:data];
    [self assertFalse:([data rawString] == @"")];
}

- (void)testSynchronousRequestNotFound
{
    var req = [CPURLRequest requestWithURL:@"NotFound"],    
        data = [CPURLConnection sendSynchronousRequest:req returningResponse:nil];

    [self assertNull:data];
}

@end<commit_msg>Tests: Updating test for CPURLConnection<commit_after>
@implementation CPURLConnectionTest : OJTestCase
{
}

- (void)testParseHTTPHeaders
{
    var testHeader = "Server: gunicorn/0.17.1\r\nDate: Fri, 11 Jan 2013 10:32:43 GMT\r\nConnection: close\r\nTransfer-Encoding: chunked\r\nVary: Accept, Cookie\r\nContent-Type: application/json; charset=utf-8\r\nCache-Control: no-cache\r\n",
        parsed = [CPHTTPURLResponse parseHTTPHeaders:testHeader];

    [self assert:@"gunicorn/0.17.1" equals:[parsed valueForKey:@"Server"]];
    [self assert:@"Fri, 11 Jan 2013 10:32:43 GMT" equals:[parsed valueForKey:@"Date"]];
    [self assert:@"close" equals:[parsed valueForKey:@"Connection"]];
    [self assert:@"chunked" equals:[parsed valueForKey:@"Transfer-Encoding"]];
    [self assert:@"Accept, Cookie" equals:[parsed valueForKey:@"Vary"]];
    [self assert:@"application/json; charset=utf-8" equals:[parsed valueForKey:@"Content-Type"]];
    [self assert:@"no-cache" equals:[parsed valueForKey:@"Cache-Control"]];
    [self assert:7 equals:[[parsed allKeys] count]];
}

- (void)testSynchronousRequestSuccess
{
    var req = [CPURLRequest requestWithURL:@"Tests/Foundation/CPURLConnectionTest.j"],
        data = [CPURLConnection sendSynchronousRequest:req returningResponse:nil];

    [self assert:CPData equals:[data class]];
    [self assertNotNull:data];
    [self assertFalse:([data rawString] == @"")];
}

- (void)testSynchronousRequestNotFound
{
    var req = [CPURLRequest requestWithURL:@"NotFound"],
        data = [CPURLConnection sendSynchronousRequest:req returningResponse:nil];

    [self assertNull:data];
}

- (void)testRequestWithCredentials
{
    var connection = [CPURLConnection connectionWithRequest:[CPURLRequest requestWithURL:@"Tests/Foundation/CPURLConnectionTest.j"] delegate:self withCredentials:YES];
    [self assertTrue:[connection withCredentials]];
}

@end
{'fraction_non_alphanumeric': 0.15084599942644106, 'fraction_numerical': 0.02007456266131345, 'mean_word_length': 5.618595825426945, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5815869', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1071, 'n_words': 204}