Commit abe61a16 authored by Denis Bilenko's avatar Denis Bilenko

pep8 fixes

parent da8ac8c6
...@@ -611,7 +611,11 @@ class TestInternational(TestCase): ...@@ -611,7 +611,11 @@ class TestInternational(TestCase):
def test(self): def test(self):
sock = self.connect() sock = self.connect()
sock.sendall('GET /%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82?%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81=%D0%BE%D1%82%D0%B2%D0%B5%D1%82 HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') sock.sendall('''GET /%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82?%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81=%D0%BE%D1%82%D0%B2%D0%B5%D1%82 HTTP/1.1
Host: localhost
Connection: close
'''.replace('\n', '\r\n'))
read_http(sock.makefile(), reason='PASSED', chunks=False, body='', content_length=0) read_http(sock.makefile(), reason='PASSED', chunks=False, body='', content_length=0)
......
...@@ -287,13 +287,17 @@ def match_line(line, command): ...@@ -287,13 +287,17 @@ def match_line(line, command):
def matches(expected, command): def matches(expected, command):
""" """
>>> matches(["* * C:\Python27\python.exe -u -m monkey_test --Event test_threading.py"], "C:\Python27\python.exe -u -m monkey_test --Event test_threading.py") >>> matches(["* * C:\Python27\python.exe -u -m monkey_test --Event test_threading.py"],
... "C:\Python27\python.exe -u -m monkey_test --Event test_threading.py")
True True
>>> matches(['* * /usr/bin/python2.5(-dbg)? -u -m monkey_test --Event test_urllib2net.py'], "/usr/bin/python2.5-dbg -u -m monkey_test --Event test_urllib2net.py") >>> matches(['* * /usr/bin/python2.5(-dbg)? -u -m monkey_test --Event test_urllib2net.py'],
... "/usr/bin/python2.5-dbg -u -m monkey_test --Event test_urllib2net.py")
True True
>>> matches(['* * /usr/bin/python2.5(-dbg)? -u -m monkey_test --Event test_urllib2net.py'], "/usr/bin/python2.5 -u -m monkey_test --Event test_urllib2net.py") >>> matches(['* * /usr/bin/python2.5(-dbg)? -u -m monkey_test --Event test_urllib2net.py'],
... "/usr/bin/python2.5 -u -m monkey_test --Event test_urllib2net.py")
True True
>>> matches(['* * /usr/bin/python2.5(-dbg)? -u -m monkey_test --Event test_urllib2net.py'], "/usr/bin/python2.6 -u -m monkey_test --Event test_urllib2net.py") >>> matches(['* * /usr/bin/python2.5(-dbg)? -u -m monkey_test --Event test_urllib2net.py'],
... "/usr/bin/python2.6 -u -m monkey_test --Event test_urllib2net.py")
False False
>>> matches(['* GEVENT_RESOLVER=ares GEVENTARES_SERVERS=8.8.8.8 python -u test__subprocess.py'], >>> matches(['* GEVENT_RESOLVER=ares GEVENTARES_SERVERS=8.8.8.8 python -u test__subprocess.py'],
... "GEVENT_RESOLVER=ares GEVENTARES_SERVERS=8.8.8.8 GEVENT_FILE=thread python -u test__subprocess.py") ... "GEVENT_RESOLVER=ares GEVENTARES_SERVERS=8.8.8.8 GEVENT_FILE=thread python -u test__subprocess.py")
......
...@@ -388,7 +388,9 @@ def simplify_tags(tags): ...@@ -388,7 +388,9 @@ def simplify_tags(tags):
>>> simplify_tags([set([('defined(world)', True), ('defined(hello)', True)]), >>> simplify_tags([set([('defined(world)', True), ('defined(hello)', True)]),
... set([('defined(world)', False), ('defined(hello)', True)])]) ... set([('defined(world)', False), ('defined(hello)', True)])])
[set([('defined(hello)', True)])] [set([('defined(hello)', True)])]
>>> simplify_tags([set([('defined(LIBEV_EMBED)', True), ('defined(_WIN32)', True)]), set([('defined(LIBEV_EMBED)', True), ('defined(_WIN32)', False)]), set([('defined(_WIN32)', False), ('defined(LIBEV_EMBED)', False)]), set([('defined(LIBEV_EMBED)', False), ('defined(_WIN32)', True)])]) >>> simplify_tags([set([('defined(LIBEV_EMBED)', True), ('defined(_WIN32)', True)]), set([('defined(LIBEV_EMBED)', True),
... ('defined(_WIN32)', False)]), set([('defined(_WIN32)', False), ('defined(LIBEV_EMBED)', False)]),
... set([('defined(LIBEV_EMBED)', False), ('defined(_WIN32)', True)])])
[] []
""" """
if not isinstance(tags, list): if not isinstance(tags, list):
...@@ -741,8 +743,8 @@ def combinations(iterable, r): ...@@ -741,8 +743,8 @@ def combinations(iterable, r):
else: else:
return return
indices[i] += 1 indices[i] += 1
for j in range(i+1, r): for j in range(i + 1, r):
indices[j] = indices[j-1] + 1 indices[j] = indices[j - 1] + 1
yield tuple(pool[i] for i in indices) yield tuple(pool[i] for i in indices)
...@@ -752,7 +754,7 @@ def product(*args, **kwds): ...@@ -752,7 +754,7 @@ def product(*args, **kwds):
pools = tuple(map(tuple, args)) * kwds.get('repeat', 1) pools = tuple(map(tuple, args)) * kwds.get('repeat', 1)
result = [[]] result = [[]]
for pool in pools: for pool in pools:
result = [x+[y] for x in result for y in pool] result = [x + [y] for x in result for y in pool]
for prod in result: for prod in result:
yield tuple(prod) yield tuple(prod)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment