Fix docstrings in qa tests

This commit fixes the module-level docstrings for the tests and helper
modules in qa. Many of these tests were uncommented previously - this
commit ensures that every test case has at least a minimum level of
commenting.
This commit is contained in:
John Newbery
2017-01-17 18:34:40 -05:00
parent 61a640ea97
commit 3f95a806b1
89 changed files with 384 additions and 479 deletions

View File

@@ -2,9 +2,7 @@
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Dummy Socks5 server for testing.
'''
"""Dummy Socks5 server for testing."""
import socket, threading, queue
import traceback, sys
@@ -20,7 +18,7 @@ class AddressType:
### Utility functions
def recvall(s, n):
'''Receive n bytes from a socket, or fail'''
"""Receive n bytes from a socket, or fail."""
rv = bytearray()
while n > 0:
d = s.recv(n)
@@ -32,7 +30,7 @@ def recvall(s, n):
### Implementation classes
class Socks5Configuration(object):
'''Proxy configuration'''
"""Proxy configuration."""
def __init__(self):
self.addr = None # Bind address (must be set)
self.af = socket.AF_INET # Bind address family
@@ -40,7 +38,7 @@ class Socks5Configuration(object):
self.auth = False # Support authentication
class Socks5Command(object):
'''Information about an incoming socks5 command'''
"""Information about an incoming socks5 command."""
def __init__(self, cmd, atyp, addr, port, username, password):
self.cmd = cmd # Command (one of Command.*)
self.atyp = atyp # Address type (one of AddressType.*)
@@ -58,9 +56,7 @@ class Socks5Connection(object):
self.peer = peer
def handle(self):
'''
Handle socks5 request according to RFC1928
'''
"""Handle socks5 request according to RFC192."""
try:
# Verify socks version
ver = recvall(self.conn, 1)[0]