commit 82a2994d21120b7505c7ebc9f78fbf6774843f35 Author: Damian Johnson atagar@torproject.org Date: Sun Jan 6 22:15:58 2013 -0800
Conforming to W391 (blank line at end of file)
I've been including an empty line at the end of files since it makes it a bit easier for me to work with via vim. I don't care overly much though so appeasing pip8. --- run_tests.py | 1 - stem/__init__.py | 1 - stem/control.py | 1 - stem/descriptor/__init__.py | 1 - stem/descriptor/export.py | 1 - stem/descriptor/extrainfo_descriptor.py | 1 - stem/descriptor/networkstatus.py | 1 - stem/descriptor/reader.py | 1 - stem/descriptor/router_status_entry.py | 1 - stem/descriptor/server_descriptor.py | 1 - stem/exit_policy.py | 1 - stem/prereq.py | 1 - stem/process.py | 1 - stem/response/__init__.py | 1 - stem/response/authchallenge.py | 1 - stem/response/events.py | 1 - stem/response/getconf.py | 1 - stem/response/getinfo.py | 1 - stem/response/mapaddress.py | 1 - stem/response/protocolinfo.py | 1 - stem/socket.py | 1 - stem/util/__init__.py | 1 - stem/util/conf.py | 1 - stem/util/connection.py | 1 - stem/util/enum.py | 1 - stem/util/log.py | 1 - stem/util/ordereddict.py | 1 - stem/util/proc.py | 1 - stem/util/str_tools.py | 1 - stem/util/system.py | 1 - stem/util/term.py | 1 - stem/util/tor_tools.py | 1 - stem/version.py | 1 - test/__init__.py | 1 - test/check_whitespace.py | 3 +-- test/integ/__init__.py | 1 - test/integ/connection/__init__.py | 1 - test/integ/connection/authentication.py | 1 - test/integ/connection/connect.py | 1 - test/integ/control/__init__.py | 1 - test/integ/control/base_controller.py | 1 - test/integ/control/controller.py | 1 - test/integ/descriptor/__init__.py | 1 - test/integ/descriptor/extrainfo_descriptor.py | 1 - test/integ/descriptor/networkstatus.py | 1 - test/integ/descriptor/reader.py | 1 - test/integ/descriptor/server_descriptor.py | 1 - test/integ/process.py | 1 - test/integ/response/__init__.py | 1 - test/integ/response/protocolinfo.py | 1 - test/integ/socket/__init__.py | 1 - test/integ/socket/control_message.py | 1 - test/integ/socket/control_socket.py | 1 - test/integ/util/__init__.py | 1 - test/integ/util/conf.py | 1 - test/integ/util/proc.py | 1 - test/integ/util/system.py | 1 - test/integ/version.py | 1 - test/mocking.py | 1 - test/network.py | 1 - test/output.py | 1 - test/prompt.py | 1 - test/runner.py | 1 - test/unit/__init__.py | 1 - test/unit/connection/__init__.py | 1 - test/unit/connection/authentication.py | 1 - test/unit/control/__init__.py | 1 - test/unit/control/controller.py | 1 - test/unit/descriptor/__init__.py | 1 - test/unit/descriptor/export.py | 1 - test/unit/descriptor/extrainfo_descriptor.py | 1 - test/unit/descriptor/networkstatus/__init__.py | 1 - .../networkstatus/directory_authority.py | 1 - test/unit/descriptor/networkstatus/document_v2.py | 1 - test/unit/descriptor/networkstatus/document_v3.py | 1 - .../descriptor/networkstatus/key_certificate.py | 1 - test/unit/descriptor/reader.py | 1 - test/unit/descriptor/router_status_entry.py | 1 - test/unit/descriptor/server_descriptor.py | 1 - test/unit/exit_policy/__init__.py | 1 - test/unit/exit_policy/policy.py | 1 - test/unit/exit_policy/rule.py | 1 - test/unit/response/__init__.py | 1 - test/unit/response/authchallenge.py | 1 - test/unit/response/control_line.py | 1 - test/unit/response/control_message.py | 1 - test/unit/response/events.py | 1 - test/unit/response/getconf.py | 1 - test/unit/response/getinfo.py | 1 - test/unit/response/mapaddress.py | 1 - test/unit/response/protocolinfo.py | 1 - test/unit/response/singleline.py | 1 - test/unit/tutorial.py | 1 - test/unit/util/__init__.py | 1 - test/unit/util/conf.py | 1 - test/unit/util/connection.py | 1 - test/unit/util/enum.py | 1 - test/unit/util/proc.py | 1 - test/unit/util/str_tools.py | 1 - test/unit/util/system.py | 1 - test/unit/util/tor_tools.py | 1 - test/unit/version.py | 1 - test/util.py | 1 - 103 files changed, 1 insertions(+), 104 deletions(-)
diff --git a/run_tests.py b/run_tests.py index d005817..c17898b 100755 --- a/run_tests.py +++ b/run_tests.py @@ -501,4 +501,3 @@ if __name__ == '__main__': else: test.output.print_line("TESTING PASSED %s" % runtime_label, term.Color.GREEN, term.Attr.BOLD) print - diff --git a/stem/__init__.py b/stem/__init__.py index 5fd34ab..f02897c 100644 --- a/stem/__init__.py +++ b/stem/__init__.py @@ -650,4 +650,3 @@ TimeoutSetType = stem.util.enum.UppercaseEnum( "DISCARD", "RESUME", ) - diff --git a/stem/control.py b/stem/control.py index 6435c38..c1f1114 100644 --- a/stem/control.py +++ b/stem/control.py @@ -1978,4 +1978,3 @@ def _case_insensitive_lookup(entries, key, default = UNDEFINED):
if default != UNDEFINED: return default else: raise ValueError("key '%s' doesn't exist in dict: %s" % (key, entries)) - diff --git a/stem/descriptor/__init__.py b/stem/descriptor/__init__.py index 98388a3..ed74b1f 100644 --- a/stem/descriptor/__init__.py +++ b/stem/descriptor/__init__.py @@ -346,4 +346,3 @@ def _get_descriptor_components(raw_contents, validate, extra_keywords = ()): return entries, extra_entries else: return entries - diff --git a/stem/descriptor/export.py b/stem/descriptor/export.py index 2231122..becc72f 100644 --- a/stem/descriptor/export.py +++ b/stem/descriptor/export.py @@ -98,4 +98,3 @@ def export_csv_file(output_file, descriptors, included_fields = (), excluded_fie raise ValueError("To export a descriptor CSV all of the descriptors must be of the same type. First descriptor was a %s but we later got a %s." % (descriptor_type_label, type(desc)))
writer.writerow(vars(desc)) - diff --git a/stem/descriptor/extrainfo_descriptor.py b/stem/descriptor/extrainfo_descriptor.py index 25c9a82..0976943 100644 --- a/stem/descriptor/extrainfo_descriptor.py +++ b/stem/descriptor/extrainfo_descriptor.py @@ -880,4 +880,3 @@ class BridgeExtraInfoDescriptor(ExtraInfoDescriptor):
def _last_keyword(self): return None - diff --git a/stem/descriptor/networkstatus.py b/stem/descriptor/networkstatus.py index 5643fe0..40b3257 100644 --- a/stem/descriptor/networkstatus.py +++ b/stem/descriptor/networkstatus.py @@ -1259,4 +1259,3 @@ class DocumentSignature(object): elif getattr(self, attr) < getattr(other, attr): return -1
return 0 - diff --git a/stem/descriptor/reader.py b/stem/descriptor/reader.py index c1c32ed..6069bfa 100644 --- a/stem/descriptor/reader.py +++ b/stem/descriptor/reader.py @@ -537,4 +537,3 @@ class DescriptorReader(object):
def __exit__(self, exit_type, value, traceback): self.stop() - diff --git a/stem/descriptor/router_status_entry.py b/stem/descriptor/router_status_entry.py index 57b018a..bc6aa46 100644 --- a/stem/descriptor/router_status_entry.py +++ b/stem/descriptor/router_status_entry.py @@ -643,4 +643,3 @@ def _decode_fingerprint(identity, validate): raise ValueError("Decoded '%s' to be '%s', which isn't a valid fingerprint" % (identity, fingerprint))
return fingerprint - diff --git a/stem/descriptor/server_descriptor.py b/stem/descriptor/server_descriptor.py index a1b486d..da9715d 100644 --- a/stem/descriptor/server_descriptor.py +++ b/stem/descriptor/server_descriptor.py @@ -888,4 +888,3 @@ class BridgeDescriptor(ServerDescriptor): return 1
return str(self).strip() > str(other).strip() - diff --git a/stem/exit_policy.py b/stem/exit_policy.py index f39fc75..eb34e97 100644 --- a/stem/exit_policy.py +++ b/stem/exit_policy.py @@ -718,4 +718,3 @@ class MicroExitPolicyRule(ExitPolicyRule):
def get_masked_bits(self): return None - diff --git a/stem/prereq.py b/stem/prereq.py index 072900a..e3b4fdc 100644 --- a/stem/prereq.py +++ b/stem/prereq.py @@ -86,4 +86,3 @@ def _check_version(minor_req): return False
return True - diff --git a/stem/process.py b/stem/process.py index a27c68e..6698c99 100644 --- a/stem/process.py +++ b/stem/process.py @@ -218,4 +218,3 @@ def launch_tor_with_config(config, tor_cmd = "tor", completion_percent = 100, in
def _get_pid(): return str(os.getpid()) - diff --git a/stem/response/__init__.py b/stem/response/__init__.py index b838bd7..1b7387b 100644 --- a/stem/response/__init__.py +++ b/stem/response/__init__.py @@ -480,4 +480,3 @@ class SingleLineResponse(ControlMessage): raise stem.ProtocolError("Received empty response") else: self.code, _, self.message = content[0] - diff --git a/stem/response/authchallenge.py b/stem/response/authchallenge.py index 25573da..cdc0ad4 100644 --- a/stem/response/authchallenge.py +++ b/stem/response/authchallenge.py @@ -49,4 +49,3 @@ class AuthChallengeResponse(stem.response.ControlMessage): self.server_nonce = binascii.a2b_hex(value) else: raise stem.ProtocolError("Missing SERVERNONCE mapping: %s" % line) - diff --git a/stem/response/events.py b/stem/response/events.py index c8e10f3..7ba077f 100644 --- a/stem/response/events.py +++ b/stem/response/events.py @@ -852,4 +852,3 @@ EVENT_TYPE_TO_CLASS = { # accounting for a bug in tor 0.2.0.22 "STATUS_SEVER": StatusEvent, } - diff --git a/stem/response/getconf.py b/stem/response/getconf.py index f8d55e7..6e96c83 100644 --- a/stem/response/getconf.py +++ b/stem/response/getconf.py @@ -53,4 +53,3 @@ class GetConfResponse(stem.response.ControlMessage):
if value is not None: self.entries[key].append(value) - diff --git a/stem/response/getinfo.py b/stem/response/getinfo.py index e68d4ae..3ef418b 100644 --- a/stem/response/getinfo.py +++ b/stem/response/getinfo.py @@ -69,4 +69,3 @@ class GetInfoResponse(stem.response.ControlMessage): reply_label = ", ".join(reply_params)
raise stem.ProtocolError("GETINFO reply doesn't match the parameters that we requested. Queried '%s' but got '%s'." % (requested_label, reply_label)) - diff --git a/stem/response/mapaddress.py b/stem/response/mapaddress.py index a6542ff..d30ccfa 100644 --- a/stem/response/mapaddress.py +++ b/stem/response/mapaddress.py @@ -36,4 +36,3 @@ class MapAddressResponse(stem.response.ControlMessage): self.entries[key] = value except ValueError: raise stem.ProtocolError(None, "MAPADDRESS returned '%s', which isn't a mapping" % message) - diff --git a/stem/response/protocolinfo.py b/stem/response/protocolinfo.py index 0530717..65a2d02 100644 --- a/stem/response/protocolinfo.py +++ b/stem/response/protocolinfo.py @@ -116,4 +116,3 @@ class ProtocolInfoResponse(stem.response.ControlMessage):
self.auth_methods = tuple(auth_methods) self.unknown_auth_methods = tuple(unknown_auth_methods) - diff --git a/stem/socket.py b/stem/socket.py index adfc83e..2055991 100644 --- a/stem/socket.py +++ b/stem/socket.py @@ -563,4 +563,3 @@ def send_formatting(message): return "+%s\r\n.\r\n" % message.replace("\n", "\r\n") else: return message + "\r\n" - diff --git a/stem/util/__init__.py b/stem/util/__init__.py index d371629..53741ae 100644 --- a/stem/util/__init__.py +++ b/stem/util/__init__.py @@ -13,4 +13,3 @@ __all__ = [ "term", "tor_tools", ] - diff --git a/stem/util/conf.py b/stem/util/conf.py index 2a6623b..05d3796 100644 --- a/stem/util/conf.py +++ b/stem/util/conf.py @@ -647,4 +647,3 @@ class Config(object): message_id = "stem.util.conf.missing_config_key_%s" % key log.log_once(message_id, log.TRACE, "config entry '%s' not found, defaulting to '%s'" % (key, default)) return default - diff --git a/stem/util/connection.py b/stem/util/connection.py index 91614b7..8eefea2 100644 --- a/stem/util/connection.py +++ b/stem/util/connection.py @@ -281,4 +281,3 @@ def cryptovariables_equal(x, y): return ( hmac_sha256(CRYPTOVARIABLE_EQUALITY_COMPARISON_NONCE, x) == hmac_sha256(CRYPTOVARIABLE_EQUALITY_COMPARISON_NONCE, y)) - diff --git a/stem/util/enum.py b/stem/util/enum.py index f120e5c..e07772d 100644 --- a/stem/util/enum.py +++ b/stem/util/enum.py @@ -166,4 +166,3 @@ class Enum(object):
for entry in self._values: yield entry - diff --git a/stem/util/log.py b/stem/util/log.py index 88b4bd6..c2f7912 100644 --- a/stem/util/log.py +++ b/stem/util/log.py @@ -202,4 +202,3 @@ def log_to_stdout(runlevel): """
get_logger().addHandler(_StdoutLogger(runlevel)) - diff --git a/stem/util/ordereddict.py b/stem/util/ordereddict.py index 4466097..778a534 100644 --- a/stem/util/ordereddict.py +++ b/stem/util/ordereddict.py @@ -127,4 +127,3 @@ class OrderedDict(dict, DictMixin):
def __ne__(self, other): return not self == other - diff --git a/stem/util/proc.py b/stem/util/proc.py index 56b2928..bfb771e 100644 --- a/stem/util/proc.py +++ b/stem/util/proc.py @@ -455,4 +455,3 @@ def _log_failure(parameter, exc): """
log.debug("proc call failed (%s): %s" % (parameter, exc)) - diff --git a/stem/util/str_tools.py b/stem/util/str_tools.py index ca4f44d..b1e854d 100644 --- a/stem/util/str_tools.py +++ b/stem/util/str_tools.py @@ -314,4 +314,3 @@ def _get_label(units, count, decimal, is_long): return count_label + long_label + ("s" if is_plural else "") else: return count_label + short_label - diff --git a/stem/util/system.py b/stem/util/system.py index bfdeb14..9e7aaa2 100644 --- a/stem/util/system.py +++ b/stem/util/system.py @@ -604,4 +604,3 @@ def call(command, default = UNDEFINED):
if default != UNDEFINED: return default else: raise exc - diff --git a/stem/util/term.py b/stem/util/term.py index d0bb02b..05b51e3 100644 --- a/stem/util/term.py +++ b/stem/util/term.py @@ -89,4 +89,3 @@ def format(msg, *attr): if encodings: return (CSI % ";".join(encodings)) + msg + RESET else: return msg - diff --git a/stem/util/tor_tools.py b/stem/util/tor_tools.py index c28bc64..d7a785a 100644 --- a/stem/util/tor_tools.py +++ b/stem/util/tor_tools.py @@ -100,4 +100,3 @@ def is_hex_digits(entry, count): """
return bool(re.match("^%s{%i}$" % (HEX_DIGIT, count), entry)) - diff --git a/stem/version.py b/stem/version.py index 7bcd289..43c96ba 100644 --- a/stem/version.py +++ b/stem/version.py @@ -266,4 +266,3 @@ Requirement = stem.util.enum.Enum( ("FEATURE_VERBOSE_NAMES", Version("0.2.2.1-alpha")), ("FEATURE_EXTENDED_EVENTS", Version("0.2.2.1-alpha")), ) - diff --git a/test/__init__.py b/test/__init__.py index 2f35bf7..43fdd7f 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -12,4 +12,3 @@ __all__ = [ "tutorial", "utils", ] - diff --git a/test/check_whitespace.py b/test/check_whitespace.py index 61ad69c..bda512e 100644 --- a/test/check_whitespace.py +++ b/test/check_whitespace.py @@ -54,7 +54,7 @@ def pep8_issues(base_path = DEFAULT_TARGET): # Pep8 only works with this one if we have four space indents (its # detection is based on multiples of four).
- ignored_issues = "E111,E121,W293,E501,E302,E701,E251,E261,W391,E127" + ignored_issues = "E111,E121,W293,E501,E302,E701,E251,E261,E127"
issues = {} pep8_output = system.call("pep8 --ignore %s %s" % (ignored_issues, base_path)) @@ -172,4 +172,3 @@ if __name__ == '__main__': print " line %s %s" % (line_count, msg)
print - diff --git a/test/integ/__init__.py b/test/integ/__init__.py index d57f031..5779e3f 100644 --- a/test/integ/__init__.py +++ b/test/integ/__init__.py @@ -12,4 +12,3 @@ __all__ = [ "process", "version", ] - diff --git a/test/integ/connection/__init__.py b/test/integ/connection/__init__.py index eec60e6..134dbe1 100644 --- a/test/integ/connection/__init__.py +++ b/test/integ/connection/__init__.py @@ -3,4 +3,3 @@ Integration tests for stem.connection. """
__all__ = ["authenticate", "connect"] - diff --git a/test/integ/connection/authentication.py b/test/integ/connection/authentication.py index 1024906..5396d02 100644 --- a/test/integ/connection/authentication.py +++ b/test/integ/connection/authentication.py @@ -394,4 +394,3 @@ class TestAuthenticate(unittest.TestCase): self.assertEqual(failure_msg, str(exc))
raise exc - diff --git a/test/integ/connection/connect.py b/test/integ/connection/connect.py index acd8864..fcf55a9 100644 --- a/test/integ/connection/connect.py +++ b/test/integ/connection/connect.py @@ -59,4 +59,3 @@ class TestConnect(unittest.TestCase): control_socket.close() else: self.assertEquals(control_socket, None) - diff --git a/test/integ/control/__init__.py b/test/integ/control/__init__.py index 10c3cf5..7e71dad 100644 --- a/test/integ/control/__init__.py +++ b/test/integ/control/__init__.py @@ -3,4 +3,3 @@ Integration tests for stem.control. """
__all__ = ["base_controller", "controller"] - diff --git a/test/integ/control/base_controller.py b/test/integ/control/base_controller.py index 319f7a8..a2814ce 100644 --- a/test/integ/control/base_controller.py +++ b/test/integ/control/base_controller.py @@ -252,4 +252,3 @@ class TestBaseController(unittest.TestCase): self.assertTrue(state_observer.timestamp < time.time()) self.assertTrue(state_observer.timestamp > time.time() - 1.0) state_observer.reset() - diff --git a/test/integ/control/controller.py b/test/integ/control/controller.py index 3514c23..901a0e1 100644 --- a/test/integ/control/controller.py +++ b/test/integ/control/controller.py @@ -832,4 +832,3 @@ class TestController(unittest.TestCase): new_circ = controller.new_circuit() circuits = controller.get_circuits() self.assertTrue(new_circ in [circ.id for circ in circuits]) - diff --git a/test/integ/descriptor/__init__.py b/test/integ/descriptor/__init__.py index eb8da22..6553b2d 100644 --- a/test/integ/descriptor/__init__.py +++ b/test/integ/descriptor/__init__.py @@ -14,4 +14,3 @@ def get_resource(filename): """
return os.path.join(DESCRIPTOR_TEST_DATA, filename) - diff --git a/test/integ/descriptor/extrainfo_descriptor.py b/test/integ/descriptor/extrainfo_descriptor.py index 44185c7..06b1a3c 100644 --- a/test/integ/descriptor/extrainfo_descriptor.py +++ b/test/integ/descriptor/extrainfo_descriptor.py @@ -169,4 +169,3 @@ k0d2aofcVbHr4fPQOSST0LXDrhFl5Fqo5um296zpJGvRUeO6S44U/EfJAGShtqWw # failing to get our attention if it does.
self.fail("Unrecognized descriptor content: %s" % unrecognized_lines) - diff --git a/test/integ/descriptor/networkstatus.py b/test/integ/descriptor/networkstatus.py index e9bfd69..d6ef4fc 100644 --- a/test/integ/descriptor/networkstatus.py +++ b/test/integ/descriptor/networkstatus.py @@ -425,4 +425,3 @@ DnN5aFtYKiTc19qIC7Nmo+afPdDEf0MlJvEOP5EWl3w= self.assertEquals("27B6B5996C426270A5C95488AA5BCEB6BCC86956", signature.identity) self.assertEquals("D5C30C15BB3F1DA27669C2D88439939E8F418FCF", signature.key_digest) self.assertEquals(expected_signature, signature.signature) - diff --git a/test/integ/descriptor/reader.py b/test/integ/descriptor/reader.py index ec957fd..a285952 100644 --- a/test/integ/descriptor/reader.py +++ b/test/integ/descriptor/reader.py @@ -485,4 +485,3 @@ class TestDescriptorReader(unittest.TestCase): self.assertEqual(test_path, skipped_path) self.assertTrue(isinstance(skip_exception, stem.descriptor.reader.UnrecognizedType)) self.assertEqual((None, None), skip_exception.mime_type) - diff --git a/test/integ/descriptor/server_descriptor.py b/test/integ/descriptor/server_descriptor.py index 35e3d2a..ae30209 100644 --- a/test/integ/descriptor/server_descriptor.py +++ b/test/integ/descriptor/server_descriptor.py @@ -313,4 +313,3 @@ Qlx9HNCqCY877ztFRC624ja2ql6A2hBcuoYMbkHjcQ4= self.assertEquals(stem.exit_policy.ExitPolicy("reject *:*"), desc.exit_policy) self.assertEquals("006FD96BA35E7785A6A3B8B75FE2E2435A13BDB4", desc.digest()) self.assertEquals([], desc.get_unrecognized_lines()) - diff --git a/test/integ/process.py b/test/integ/process.py index 5811e37..7aa3382 100644 --- a/test/integ/process.py +++ b/test/integ/process.py @@ -176,4 +176,3 @@ class TestProcess(unittest.TestCase): time.sleep(1)
self.fail("tor didn't quit after the controller that owned it disconnected") - diff --git a/test/integ/response/__init__.py b/test/integ/response/__init__.py index 2e3a991..d44f035 100644 --- a/test/integ/response/__init__.py +++ b/test/integ/response/__init__.py @@ -3,4 +3,3 @@ Integration tests for stem.response. """
__all__ = ["protocolinfo"] - diff --git a/test/integ/response/protocolinfo.py b/test/integ/response/protocolinfo.py index fb5b163..2affe17 100644 --- a/test/integ/response/protocolinfo.py +++ b/test/integ/response/protocolinfo.py @@ -151,4 +151,3 @@ class TestProtocolInfo(unittest.TestCase): self.assertEqual((), protocolinfo_response.unknown_auth_methods) self.assertEqual(tuple(auth_methods), protocolinfo_response.auth_methods) self.assertEqual(auth_cookie_path, protocolinfo_response.cookie_path) - diff --git a/test/integ/socket/__init__.py b/test/integ/socket/__init__.py index 7479a48..ec37503 100644 --- a/test/integ/socket/__init__.py +++ b/test/integ/socket/__init__.py @@ -3,4 +3,3 @@ Integration tests for stem.socket. """
__all__ = ["control_message", "control_socket"] - diff --git a/test/integ/socket/control_message.py b/test/integ/socket/control_message.py index af6af16..2a358cb 100644 --- a/test/integ/socket/control_message.py +++ b/test/integ/socket/control_message.py @@ -169,4 +169,3 @@ class TestControlMessage(unittest.TestCase): self.assertTrue(re.match("BW [0-9]+ [0-9]+", str(bw_event))) self.assertTrue(re.match("650 BW [0-9]+ [0-9]+\r\n", bw_event.raw_content())) self.assertEquals(("650", " "), bw_event.content()[0][:2]) - diff --git a/test/integ/socket/control_socket.py b/test/integ/socket/control_socket.py index a775b20..2f2a4e7 100644 --- a/test/integ/socket/control_socket.py +++ b/test/integ/socket/control_socket.py @@ -127,4 +127,3 @@ class TestControlSocket(unittest.TestCase): control_socket.close() self.assertRaises(stem.SocketClosed, control_socket.send, "PROTOCOLINFO 1") control_socket.connect() - diff --git a/test/integ/util/__init__.py b/test/integ/util/__init__.py index 3d275b8..eac6be5 100644 --- a/test/integ/util/__init__.py +++ b/test/integ/util/__init__.py @@ -3,4 +3,3 @@ Integration tests for stem.util.* contents. """
__all__ = ["conf", "proc", "system"] - diff --git a/test/integ/util/conf.py b/test/integ/util/conf.py index c51bc0c..6fedca1 100644 --- a/test/integ/util/conf.py +++ b/test/integ/util/conf.py @@ -133,4 +133,3 @@ class TestConf(unittest.TestCase): self.assertEquals("yup, I'm there", test_config.get_value("single_value")) self.assertEquals(["a", "b", "c"], test_config.get_value("multiple_values", multiple = True)) self.assertEquals(HERALD_POEM, test_config.get_value("multiline_value")) - diff --git a/test/integ/util/proc.py b/test/integ/util/proc.py index 8da3730..557c7a8 100644 --- a/test/integ/util/proc.py +++ b/test/integ/util/proc.py @@ -101,4 +101,3 @@ class TestProc(unittest.TestCase): return
self.fail() - diff --git a/test/integ/util/system.py b/test/integ/util/system.py index 7de90ec..0564118 100644 --- a/test/integ/util/system.py +++ b/test/integ/util/system.py @@ -393,4 +393,3 @@ class TestSystem(unittest.TestCase): self.assertEquals(home_dir, stem.util.system.expand_path("~/")) self.assertEquals(home_dir, stem.util.system.expand_path("~%s" % username)) self.assertEquals(os.path.join(home_dir, "foo"), stem.util.system.expand_path("~%s/foo" % username)) - diff --git a/test/integ/version.py b/test/integ/version.py index 4e9409f..9195126 100644 --- a/test/integ/version.py +++ b/test/integ/version.py @@ -63,4 +63,3 @@ class TestVersion(unittest.TestCase): tor_version = list(version_response)[0] tor_version = tor_version[8:tor_version.find(' ', 8)] stem.version.Version(tor_version) - diff --git a/test/mocking.py b/test/mocking.py index 99f18b2..12c6bef 100644 --- a/test/mocking.py +++ b/test/mocking.py @@ -936,4 +936,3 @@ def sign_descriptor_content(desc_content): desc_content = desc_content[:rst_start] + router_signature_token + router_signature_start + signature_base64 + router_signature_end
return desc_content - diff --git a/test/network.py b/test/network.py index a0d5ded..cab998a 100644 --- a/test/network.py +++ b/test/network.py @@ -245,4 +245,3 @@ class SocksPatch(object):
def __exit__(self, exit_type, value, traceback): socket.socket = _socket_socket - diff --git a/test/output.py b/test/output.py index 8295b1b..d79db70 100644 --- a/test/output.py +++ b/test/output.py @@ -197,4 +197,3 @@ class ErrorTracker(object): def __iter__(self): for error_line in self._errors: yield error_line - diff --git a/test/prompt.py b/test/prompt.py index 290d1ce..32e75ab 100644 --- a/test/prompt.py +++ b/test/prompt.py @@ -88,4 +88,3 @@ def controller(): controller = stem.control.Controller.from_port(control_port = CONTROL_PORT) controller.authenticate() return controller - diff --git a/test/runner.py b/test/runner.py index f3e44f3..17abefb 100644 --- a/test/runner.py +++ b/test/runner.py @@ -689,4 +689,3 @@ class Runner(object): except OSError, exc: test.output.print_line(" failed to start tor: %s\n" % exc, *ERROR_ATTR) raise exc - diff --git a/test/unit/__init__.py b/test/unit/__init__.py index a57679c..1932601 100644 --- a/test/unit/__init__.py +++ b/test/unit/__init__.py @@ -11,4 +11,3 @@ __all__ = [ "util", "version", ] - diff --git a/test/unit/connection/__init__.py b/test/unit/connection/__init__.py index 7073319..103b792 100644 --- a/test/unit/connection/__init__.py +++ b/test/unit/connection/__init__.py @@ -3,4 +3,3 @@ Unit tests for stem.connection. """
__all__ = ["authentication"] - diff --git a/test/unit/connection/authentication.py b/test/unit/connection/authentication.py index abc4af8..0c05f21 100644 --- a/test/unit/connection/authentication.py +++ b/test/unit/connection/authentication.py @@ -154,4 +154,3 @@ class TestAuthenticate(unittest.TestCase):
# revert logging back to normal stem_logger.setLevel(log.logging_level(log.TRACE)) - diff --git a/test/unit/control/__init__.py b/test/unit/control/__init__.py index 448a597..6db492b 100644 --- a/test/unit/control/__init__.py +++ b/test/unit/control/__init__.py @@ -3,4 +3,3 @@ Unit tests for stem.control. """
__all__ = ["controller"] - diff --git a/test/unit/control/controller.py b/test/unit/control/controller.py index c669870..aa2c7ae 100644 --- a/test/unit/control/controller.py +++ b/test/unit/control/controller.py @@ -311,4 +311,3 @@ class TestControl(unittest.TestCase):
for test_input in malformed_inputs: self.assertRaises(ProtocolError, _parse_circ_path, test_input) - diff --git a/test/unit/descriptor/__init__.py b/test/unit/descriptor/__init__.py index 163f33b..aceb1ea 100644 --- a/test/unit/descriptor/__init__.py +++ b/test/unit/descriptor/__init__.py @@ -10,4 +10,3 @@ __all__ = [ "router_status_entry", "server_descriptor", ] - diff --git a/test/unit/descriptor/export.py b/test/unit/descriptor/export.py index 5d43a8f..bd25c6e 100644 --- a/test/unit/descriptor/export.py +++ b/test/unit/descriptor/export.py @@ -102,4 +102,3 @@ class TestExport(unittest.TestCase): server_desc = get_relay_server_descriptor() bridge_desc = get_bridge_server_descriptor() self.assertRaises(ValueError, export_csv, (server_desc, bridge_desc)) - diff --git a/test/unit/descriptor/extrainfo_descriptor.py b/test/unit/descriptor/extrainfo_descriptor.py index 2c33225..4ef0276 100644 --- a/test/unit/descriptor/extrainfo_descriptor.py +++ b/test/unit/descriptor/extrainfo_descriptor.py @@ -503,4 +503,3 @@ class TestExtraInfoDescriptor(unittest.TestCase): self.assertEquals("ninja", desc.nickname)
return desc - diff --git a/test/unit/descriptor/networkstatus/__init__.py b/test/unit/descriptor/networkstatus/__init__.py index 75c27b7..e1ffef4 100644 --- a/test/unit/descriptor/networkstatus/__init__.py +++ b/test/unit/descriptor/networkstatus/__init__.py @@ -3,4 +3,3 @@ Unit tests for stem.descriptor.networkstatus. """
__all__ = ["directory_authority", "key_certificate", "document_v3"] - diff --git a/test/unit/descriptor/networkstatus/directory_authority.py b/test/unit/descriptor/networkstatus/directory_authority.py index 545d72f..68e4713 100644 --- a/test/unit/descriptor/networkstatus/directory_authority.py +++ b/test/unit/descriptor/networkstatus/directory_authority.py @@ -247,4 +247,3 @@ class TestDirectoryAuthority(unittest.TestCase):
authority = DirectoryAuthority(content, False, True) self.assertEqual('turtles', authority.nickname) - diff --git a/test/unit/descriptor/networkstatus/document_v2.py b/test/unit/descriptor/networkstatus/document_v2.py index 70f904e..88561e6 100644 --- a/test/unit/descriptor/networkstatus/document_v2.py +++ b/test/unit/descriptor/networkstatus/document_v2.py @@ -29,4 +29,3 @@ class TestNetworkStatusDocument(unittest.TestCase): self.assertEquals([], document.options) self.assertEquals("moria2", document.signing_authority) self.assertEquals(NETWORK_STATUS_DOCUMENT_FOOTER_V2[0][1][7:], document.signature) - diff --git a/test/unit/descriptor/networkstatus/document_v3.py b/test/unit/descriptor/networkstatus/document_v3.py index 6a825ea..f422f5b 100644 --- a/test/unit/descriptor/networkstatus/document_v3.py +++ b/test/unit/descriptor/networkstatus/document_v3.py @@ -802,4 +802,3 @@ class TestNetworkStatusDocument(unittest.TestCase):
document = NetworkStatusDocumentV3(content, validate = False) self.assertEquals((DirectoryAuthority(authority_content, False, True),), document.directory_authorities) - diff --git a/test/unit/descriptor/networkstatus/key_certificate.py b/test/unit/descriptor/networkstatus/key_certificate.py index c3e8c9f..fdd90c5 100644 --- a/test/unit/descriptor/networkstatus/key_certificate.py +++ b/test/unit/descriptor/networkstatus/key_certificate.py @@ -190,4 +190,3 @@ class TestKeyCertificate(unittest.TestCase):
certificate = KeyCertificate(content, False) self.assertEquals(None, getattr(certificate, attr)) - diff --git a/test/unit/descriptor/reader.py b/test/unit/descriptor/reader.py index 28b7155..4ae0aff 100644 --- a/test/unit/descriptor/reader.py +++ b/test/unit/descriptor/reader.py @@ -93,4 +93,3 @@ class TestDescriptorReader(unittest.TestCase): mocking.support_with(test_content) mocking.mock(open, mocking.return_value(test_content)) self.assertRaises(TypeError, stem.descriptor.reader.load_processed_files, "") - diff --git a/test/unit/descriptor/router_status_entry.py b/test/unit/descriptor/router_status_entry.py index fd668d2..a0ff74d 100644 --- a/test/unit/descriptor/router_status_entry.py +++ b/test/unit/descriptor/router_status_entry.py @@ -526,4 +526,3 @@ class TestRouterStatusEntry(unittest.TestCase): self.assertEquals(expected_value, getattr(entry, attr)) else: self.assertEquals("caerSidi", entry.nickname) - diff --git a/test/unit/descriptor/server_descriptor.py b/test/unit/descriptor/server_descriptor.py index 0edf429..e3f4e78 100644 --- a/test/unit/descriptor/server_descriptor.py +++ b/test/unit/descriptor/server_descriptor.py @@ -411,4 +411,3 @@ class TestServerDescriptor(unittest.TestCase): else: # check a default attribute self.assertEquals("caerSidi", desc.nickname) - diff --git a/test/unit/exit_policy/__init__.py b/test/unit/exit_policy/__init__.py index 99a4651..04ea48a 100644 --- a/test/unit/exit_policy/__init__.py +++ b/test/unit/exit_policy/__init__.py @@ -3,4 +3,3 @@ Unit tests for stem.exit_policy.py contents. """
__all__ = ["policy", "rule"] - diff --git a/test/unit/exit_policy/policy.py b/test/unit/exit_policy/policy.py index c4e675e..12cc52a 100644 --- a/test/unit/exit_policy/policy.py +++ b/test/unit/exit_policy/policy.py @@ -188,4 +188,3 @@ class TestExitPolicy(unittest.TestCase):
self.assertFalse(policy.can_exit_to('127.0.0.1', 79)) self.assertTrue(policy.can_exit_to('127.0.0.1', 80)) - diff --git a/test/unit/exit_policy/rule.py b/test/unit/exit_policy/rule.py index 0341f43..538418d 100644 --- a/test/unit/exit_policy/rule.py +++ b/test/unit/exit_policy/rule.py @@ -322,4 +322,3 @@ class TestExitPolicyRule(unittest.TestCase):
for match_args, expected_result in matches.items(): self.assertEquals(expected_result, rule.is_match(*match_args)) - diff --git a/test/unit/response/__init__.py b/test/unit/response/__init__.py index 51f3cd1..3320f64 100644 --- a/test/unit/response/__init__.py +++ b/test/unit/response/__init__.py @@ -12,4 +12,3 @@ __all__ = [ "authchallenge", "singleline" ] - diff --git a/test/unit/response/authchallenge.py b/test/unit/response/authchallenge.py index 436bca0..0583d04 100644 --- a/test/unit/response/authchallenge.py +++ b/test/unit/response/authchallenge.py @@ -52,4 +52,3 @@ class TestAuthChallengeResponse(unittest.TestCase): remaining_comp = auth_challenge_comp[:index] + auth_challenge_comp[index + 1:] control_message = mocking.get_message(' '.join(remaining_comp)) self.assertRaises(stem.ProtocolError, stem.response.convert, "AUTHCHALLENGE", control_message) - diff --git a/test/unit/response/control_line.py b/test/unit/response/control_line.py index 1d0a0dd..546a410 100644 --- a/test/unit/response/control_line.py +++ b/test/unit/response/control_line.py @@ -164,4 +164,3 @@ class TestControlLine(unittest.TestCase): line = stem.response.ControlLine(cookie_file_entry) self.assertEquals(line.pop_mapping(True, True), ('COOKIEFILE', r'/tmp/my data"dir//control_auth_cookie')) self.assertTrue(line.is_empty()) - diff --git a/test/unit/response/control_message.py b/test/unit/response/control_message.py index 51ad8f0..091aff9 100644 --- a/test/unit/response/control_message.py +++ b/test/unit/response/control_message.py @@ -182,4 +182,3 @@ class TestControlMessage(unittest.TestCase): self.assertTrue(line.endswith(message_lines.pop(0)))
return message - diff --git a/test/unit/response/events.py b/test/unit/response/events.py index 57dda95..885be6b 100644 --- a/test/unit/response/events.py +++ b/test/unit/response/events.py @@ -1118,4 +1118,3 @@ class TestEvents(unittest.TestCase): self.assertTrue("STATUS_GENERAL event had an unrecognized runlevel" in logged_events[0])
stem_logger.removeHandler(logging_buffer) - diff --git a/test/unit/response/getconf.py b/test/unit/response/getconf.py index 8a3aedb..a072738 100644 --- a/test/unit/response/getconf.py +++ b/test/unit/response/getconf.py @@ -113,4 +113,3 @@ class TestGetConfResponse(unittest.TestCase):
control_message = mocking.get_message(INVALID_RESPONSE) self.assertRaises(stem.ProtocolError, stem.response.convert, "GETCONF", control_message) - diff --git a/test/unit/response/getinfo.py b/test/unit/response/getinfo.py index f5481c6..589d7b9 100644 --- a/test/unit/response/getinfo.py +++ b/test/unit/response/getinfo.py @@ -136,4 +136,3 @@ class TestGetInfoResponse(unittest.TestCase):
control_message = mocking.get_message(MISSING_MULTILINE_NEWLINE) self.assertRaises(stem.ProtocolError, stem.response.convert, "GETINFO", control_message) - diff --git a/test/unit/response/mapaddress.py b/test/unit/response/mapaddress.py index d4884b6..c3e0b18 100644 --- a/test/unit/response/mapaddress.py +++ b/test/unit/response/mapaddress.py @@ -81,4 +81,3 @@ class TestMapAddressResponse(unittest.TestCase):
control_message = mocking.get_message(INVALID_RESPONSE) self.assertRaises(stem.ProtocolError, stem.response.convert, "MAPADDRESS", control_message) - diff --git a/test/unit/response/protocolinfo.py b/test/unit/response/protocolinfo.py index 23b8173..28cd212 100644 --- a/test/unit/response/protocolinfo.py +++ b/test/unit/response/protocolinfo.py @@ -184,4 +184,3 @@ class TestProtocolInfoResponse(unittest.TestCase):
# reset system call mocking mocking.revert_mocking() - diff --git a/test/unit/response/singleline.py b/test/unit/response/singleline.py index 30c967f..e3b68e5 100644 --- a/test/unit/response/singleline.py +++ b/test/unit/response/singleline.py @@ -33,4 +33,3 @@ class TestSingleLineResponse(unittest.TestCase): def test_multi_line_response(self): message = mocking.get_message(MULTILINE_RESPONSE) self.assertRaises(stem.ProtocolError, stem.response.convert, "SINGLELINE", message) - diff --git a/test/unit/tutorial.py b/test/unit/tutorial.py index 79baa8c..6358344 100644 --- a/test/unit/tutorial.py +++ b/test/unit/tutorial.py @@ -85,4 +85,3 @@ class TestTutorial(unittest.TestCase): return
self.assertEqual(4, count) - diff --git a/test/unit/util/__init__.py b/test/unit/util/__init__.py index 33b81d3..a5faacf 100644 --- a/test/unit/util/__init__.py +++ b/test/unit/util/__init__.py @@ -11,4 +11,3 @@ __all__ = [ "system", "tor_tools", ] - diff --git a/test/unit/util/conf.py b/test/unit/util/conf.py index 9006b54..abb645a 100644 --- a/test/unit/util/conf.py +++ b/test/unit/util/conf.py @@ -223,4 +223,3 @@ class TestConf(unittest.TestCase):
self.assertEquals(None, test_config.get_value("foo")) self.assertEquals("hello", test_config.get_value("foo", "hello")) - diff --git a/test/unit/util/connection.py b/test/unit/util/connection.py index 673da71..358ab49 100644 --- a/test/unit/util/connection.py +++ b/test/unit/util/connection.py @@ -154,4 +154,3 @@ class TestConnection(unittest.TestCase):
self.assertRaises(ValueError, stem.util.connection.get_address_binary, "") self.assertRaises(ValueError, stem.util.connection.get_address_binary, "blarg") - diff --git a/test/unit/util/enum.py b/test/unit/util/enum.py index c5b73bf..1b33296 100644 --- a/test/unit/util/enum.py +++ b/test/unit/util/enum.py @@ -46,4 +46,3 @@ class TestEnum(unittest.TestCase):
# keys method self.assertEquals(("ANT", "WASP", "LADYBUG", "FIREFLY"), insects.keys()) - diff --git a/test/unit/util/proc.py b/test/unit/util/proc.py index 13942b4..85aff2f 100644 --- a/test/unit/util/proc.py +++ b/test/unit/util/proc.py @@ -168,4 +168,3 @@ class TestProc(unittest.TestCase): ]
self.assertEquals(expected_results, proc.get_connections(pid)) - diff --git a/test/unit/util/str_tools.py b/test/unit/util/str_tools.py index 8c161fb..ed31c43 100644 --- a/test/unit/util/str_tools.py +++ b/test/unit/util/str_tools.py @@ -150,4 +150,3 @@ class TestStrTools(unittest.TestCase):
for arg in invalid_input: self.assertRaises(ValueError, str_tools.parse_iso_timestamp, arg) - diff --git a/test/unit/util/system.py b/test/unit/util/system.py index b948696..a3c5e5a 100644 --- a/test/unit/util/system.py +++ b/test/unit/util/system.py @@ -323,4 +323,3 @@ class TestSystem(unittest.TestCase): self.assertEquals("C:\tmp", system.expand_path(".\", "C:\tmp")) self.assertEquals("C:\tmp\foo", system.expand_path("foo", "C:\tmp")) self.assertEquals("C:\tmp\foo", system.expand_path(".\foo", "C:\tmp")) - diff --git a/test/unit/util/tor_tools.py b/test/unit/util/tor_tools.py index 0c0e6e2..59f448b 100644 --- a/test/unit/util/tor_tools.py +++ b/test/unit/util/tor_tools.py @@ -80,4 +80,3 @@ class TestTorTools(unittest.TestCase):
for circuit_id in invalid_circuit_ids: self.assertFalse(stem.util.tor_tools.is_valid_circuit_id(circuit_id)) - diff --git a/test/unit/version.py b/test/unit/version.py index 9fb72e0..78a1a49 100644 --- a/test/unit/version.py +++ b/test/unit/version.py @@ -257,4 +257,3 @@ class TestVersion(unittest.TestCase): """
self.assertEqual(version, str(Version(version))) - diff --git a/test/util.py b/test/util.py index c8c40af..db6f53c 100644 --- a/test/util.py +++ b/test/util.py @@ -75,4 +75,3 @@ def negotiate_socks(sock, host, port): raise ProtocolError(error_msgs.get(response[1], "SOCKS server returned unrecognized error code"))
return [socket.inet_ntoa(response[4:]), struct.unpack("!H", response[2:4])[0]] -
tor-commits@lists.torproject.org