# Path: oppy/socks/socks.py
# class MalformedSOCKSHandshake(Exception):
# class MalformedSOCKSRequest(Exception):
# class NoSupportedMethods(Exception):
# class UnsupportedAddressType(Exception):
# class UnsupportedCommand(Exception):
# class UnsupportedVersion(Exception):
# class OppySOCKSProtocol(Protocol):
# class OppySOCKSProtocolFactory(ServerFactory):
# VER = "\x05"
# RSV = "\x00"
# NO_AUTH_REQUIRED        = "\x00"
# NO_ACCEPTABLE_METHODS   = "\xFF"
# CONNECT = "\x01"
# BIND    = "\x02"
# UDP     = "\x03"
# SUCCEEDED                   = "\x00"
# SOCKS_FAILURE               = "\x01"
# NETWORK_FAILURE             = "\x02"
# NETWORK_UNREACHABLE         = "\x03"
# HOST_UNREACHABLE            = "\x04"
# CONNECTION_REFUSED          = "\x05"
# TTL_EXPIRED                 = "\x06"
# COMMAND_NOT_SUPPORTED       = "\x07"
# ADDRESS_TYPE_NOT_SUPPORTED  = "\x08"
# DOMAIN_NAME = "\x03"
# VER_LEN = 1
# NMETHODS_LEN = 1
# CMD_LEN = 1
# RSV_LEN = 1
# ADDR_TYPE_LEN = 1
# PORT_LEN = 2
# REQUEST_HEADER_LEN = VER_LEN+CMD_LEN+RSV_LEN+ADDR_TYPE_LEN
#         ADDR = "\x7f\x00\x00\x01"
#         PORT = "\x00\x00"
#     def __init__(self, circuit_manager):
#     def dataReceived(self, data):
#     def recv(self, data):
#     def closeFromStream(self):
#     def _handleHandshake(self, data):
#     def _handleRequest(self, data):
#     def _sendReply(self, REP):
#     def connectionLost(self, reason):
#     def connectionMade(self):
# def _parseHandshake(data):
# def _parseSOCKSRequestHeader(data):
# def _parseRequest(data, addr_type):
# def _parseIPv4Request(data):
# def _parseHostRequest(data):
# def _parseIPv6Request(data):
#     def __init__(self, circuit_manager):
#     def buildProtocol(self, addr):


import mock
from twisted.trial import unittest
from oppy.socks import socks




class SOCKSTest(unittest.TestCase):
    
    @mock.patch('oppy.circuit.circuitmanager.CircuitManager', autospec=True)
    def setUp(self, mock_cm):
        self.mock_cm = mock_cm

# Path: oppy/socks/socks.py
# class MalformedSOCKSHandshake(Exception):
# class MalformedSOCKSRequest(Exception):
# class NoSupportedMethods(Exception):
# class UnsupportedAddressType(Exception):
# class UnsupportedCommand(Exception):
# class UnsupportedVersion(Exception):
# class OppySOCKSProtocol(Protocol):
# class OppySOCKSProtocolFactory(ServerFactory):
# VER = "\x05"
# RSV = "\x00"
# NO_AUTH_REQUIRED        = "\x00"
# NO_ACCEPTABLE_METHODS   = "\xFF"
# CONNECT = "\x01"
# BIND    = "\x02"
# UDP     = "\x03"
# SUCCEEDED                   = "\x00"
# SOCKS_FAILURE               = "\x01"
# NETWORK_FAILURE             = "\x02"
# NETWORK_UNREACHABLE         = "\x03"
# HOST_UNREACHABLE            = "\x04"
# CONNECTION_REFUSED          = "\x05"
# TTL_EXPIRED                 = "\x06"
# COMMAND_NOT_SUPPORTED       = "\x07"
# ADDRESS_TYPE_NOT_SUPPORTED  = "\x08"
# DOMAIN_NAME = "\x03"
# VER_LEN = 1
# NMETHODS_LEN = 1
# CMD_LEN = 1
# RSV_LEN = 1
# ADDR_TYPE_LEN = 1
# PORT_LEN = 2
# REQUEST_HEADER_LEN = VER_LEN+CMD_LEN+RSV_LEN+ADDR_TYPE_LEN
#         ADDR = "\x7f\x00\x00\x01"
#         PORT = "\x00\x00"
#     def __init__(self, circuit_manager):
#     def dataReceived(self, data):
#     def recv(self, data):
#     def closeFromStream(self):
#     def _handleHandshake(self, data):
#     def _handleRequest(self, data):
#     def _sendReply(self, REP):
#     def connectionLost(self, reason):
#     def connectionMade(self):
# def _parseHandshake(data):
# def _parseSOCKSRequestHeader(data):
# def _parseRequest(data, addr_type):
# def _parseIPv4Request(data):
# def _parseHostRequest(data):
# def _parseIPv6Request(data):
#     def __init__(self, circuit_manager):
#     def buildProtocol(self, addr):


# Path: oppy/tests/unit/socks/test_socks.py
import mock
from twisted.trial import unittest
from oppy.socks import socks





class SOCKSTest(unittest.TestCase):
    
    @mock.patch('oppy.circuit.circuitmanager.CircuitManager', autospec=True)
    def setUp(self, mock_cm):
        self.mock_cm = mock_cm

        self.socksp = socks.OppySOCKSProtocol(self.mock_cm)