<commit_before>from mock import ANY

from wampy.networking.connections.tcp import TCPConnection
from wampy.networking.connections.http import HttpConnection
from wampy.networking.connections.wamp import WampConnection


def test_remote_tcp_crossbar_connection():
    connection = TCPConnection(host='wampy.online', port=8082)
    connection.connect()


def test_remote_http_crossbar_connection():
    connection = HttpConnection(host='wampy.online', port=8082)
    connection.connect()

    assert connection.status == 404  # yes, this is the expected behaviour!
    assert connection.headers == {
        'status': 404,
        'content-length': ANY,
        'server': 'crossbar/0.13.2',
        'date': ANY,
        'status_info': [
            'HTTP/1.1', '404', 'Not Found'
        ],
        'content-type': 'text/html'
    }


def test_remote_host_wamp_connection():
    connection = WampConnection(host='wampy.online', port=8082)
    connection.connect()

    assert connection.status == 101
    assert connection.headers == {
        'status': 101,
        'upgrade': 'websocket',
        'sec-websocket-accept': ANY,
        'x-powered-by': 'autobahnpython/0.13.1',
        'sec-websocket-protocol': 'wamp.2.json',
        'server': 'crossbar/0.13.2',
        'connection': 'upgrade',
        'status_info': [
            'HTTP/1.1', '101', 'Switching Protocols'
        ]
    }<commit_msg>remove dead weight<commit_after>from mock import ANY

from wampy.networking.connection import WampConnection


def test_remote_host_wamp_connection():
    connection = WampConnection(host='wampy.online', port=8082)
    connection.connect()

    assert connection.status == 101
    assert connection.headers == {
        'status': 101,
        'upgrade': 'websocket',
        'sec-websocket-accept': ANY,
        'x-powered-by': 'autobahnpython/0.13.1',
        'sec-websocket-protocol': 'wamp.2.json',
        'server': 'crossbar/0.13.2',
        'connection': 'upgrade',
        'status_info': [
            'HTTP/1.1', '101', 'Switching Protocols'
        ]
    }
{'fraction_non_alphanumeric': 0.1371124031007752, 'fraction_numerical': 0.03439922480620155, 'mean_word_length': 2.90359168241966, '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': '4211973', 'n_tokens_mistral': 691, 'n_tokens_neox': 638, 'n_words': 124}