<commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from echo_client import echo_client


def test_best_case():
    msg = "GET /path/to/file.txt HTTP/1.1"
    out = msg.encode('utf-8')
    response = echo_client(out)
    if isinstance(response, str):
        in_text = response.decode('utf-8')
    assert "200 OK" in in_text
    assert 'text/plain;' in in_text
    assert 'path/to/file.txt' in in_text


def test_method_post():
    msg = "POST /path/to/file.txt HTTP/1.1"
    out = msg.encode('utf-8')
    response = echo_client(out)
    if isinstance(response, str):
        in_text = response.decode('utf-8')
    assert '405 Method not allowed' in in_text
    assert 'Allow: GET' in in_text


def test_http10():
    msg = 'GET /path/to/file.txt HTTP/1.0'
    out = msg.encode('utf-8')
    response = echo_client(out)
    if isinstance(response, str):
        in_text = response.decode('utf-8')
    assert '505 HTTP Version Not Supported' in in_text

def test_unicode_path():
    msg = 'GET /path/to/fileɯ.png HTTP/1.1'
    out = msg.encode('utf-8')
    response = echo_client(out)
    if isinstance(response, str):
        in_text = response.decode('utf-8')
    assert '200 OK' in in_text
    assert 'image/png' in in_text
    assert 'path/to/fileɯ.png' in in_text<commit_msg>cleaned up whitespace in tests<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from echo_client import echo_client


def test_best_case():
    msg = "GET /path/to/file.txt HTTP/1.1"
    out = msg.encode('utf-8')
    response = echo_client(out)
    if isinstance(response, str):
        in_text = response.decode('utf-8')
    assert "200 OK" in in_text
    assert 'text/plain;' in in_text
    assert 'path/to/file.txt' in in_text


def test_method_post():
    msg = "POST /path/to/file.txt HTTP/1.1"
    out = msg.encode('utf-8')
    response = echo_client(out)
    if isinstance(response, str):
        in_text = response.decode('utf-8')
    assert '405 Method not allowed' in in_text
    assert 'Allow: GET' in in_text


def test_http10():
    msg = 'GET /path/to/file.txt HTTP/1.0'
    out = msg.encode('utf-8')
    response = echo_client(out)
    if isinstance(response, str):
        in_text = response.decode('utf-8')
    assert '505 HTTP Version Not Supported' in in_text


def test_unicode_path():
    msg = 'GET /path/to/fileɯ.png HTTP/1.1'
    out = msg.encode('utf-8')
    response = echo_client(out)
    if isinstance(response, str):
        in_text = response.decode('utf-8')
    assert '200 OK' in in_text
    assert 'image/png' in in_text
    assert 'path/to/fileɯ.png' in in_text
{'fraction_non_alphanumeric': 0.13079847908745248, 'fraction_numerical': 0.023574144486692015, 'mean_word_length': 2.9863636363636363, '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': '1028217', 'n_tokens_mistral': 940, 'n_tokens_neox': 914, 'n_words': 237}