[tor-commits] [ooni-probe/master] PEP8 Corrections
art at torproject.org
art at torproject.org
Mon Jul 27 13:44:21 UTC 2015
commit a987066560c219ceee0748fd379302e0c1d2f156
Author: anadahz <kojgelo at inbox.com>
Date: Fri Apr 17 01:45:55 2015 +0200
PEP8 Corrections
---
ooni/nettests/blocking/meek_fronted_requests.py | 34 +++++++++++------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/ooni/nettests/blocking/meek_fronted_requests.py b/ooni/nettests/blocking/meek_fronted_requests.py
index 762e27e..3795008 100644
--- a/ooni/nettests/blocking/meek_fronted_requests.py
+++ b/ooni/nettests/blocking/meek_fronted_requests.py
@@ -7,12 +7,12 @@ from ooni.templates import httpt
from ooni.utils import log
class UsageOptions(usage.Options):
- optParameters = [ ['ExpectedBody', 'B',
+ optParameters = [ ['expectedBody', 'B',
'Iâm just a happy little web server.\n',
'Expected body content from GET response'],
- ['DomainName', 'D', None,
- 'Specify a single fronted DomainName to test.'],
- ['HostHeader', 'H', None,
+ ['domainName', 'D', None,
+ 'Specify a single fronted domainName to test.'],
+ ['hostHeader', 'H', None,
'Specify "inside" Host Header to test.']
]
@@ -22,7 +22,7 @@ class meekTest(httpt.HTTPTest):
Header of the "inside" meek-server. The meek-server handles a GET request
and response with: "Iâm just a happy little web server.\n".
The input file should be formatted as (one per line):
- "DomainName:HostHeader"
+ "domainName:hostHeader"
www.google.com:meek-reflect.appspot.com
ajax.aspnetcdn.com:az668014.vo.msecnd.net
a0.awsstatic.com:d2zfqthxsdq309.cloudfront.net
@@ -33,7 +33,7 @@ class meekTest(httpt.HTTPTest):
usageOptions = UsageOptions
inputFile = ['file', 'f', None,
- "File containing the DomainName:HostHeader combinations to\
+ "File containing the domainName:hostHeader combinations to\
be tested, one per line."]
inputs = [('www.google.com', 'meek-reflect.appspot.com'),
('ajax.aspnetcdn.com', 'az668014.vo.msecnd.net'),
@@ -49,31 +49,31 @@ class meekTest(httpt.HTTPTest):
if self.input:
if (isinstance(self.input, tuple) or isinstace(self.input, list)):
- self.DomainName, self.header = self.input
+ self.domainName, self.header = self.input
else:
- self.DomainName, self.header = self.input.split(':')
- elif (self.localOptions['DomainName'] and
- self.localOptions['HostHeader']):
- self.DomainName = self.localOptions['DomainName']
- self.header = self.localOptions['HostHeader']
+ self.domainName, self.header = self.input.split(':')
+ elif (self.localOptions['domainName'] and
+ self.localOptions['hostHeader']):
+ self.domainName = self.localOptions['domainName']
+ self.header = self.localOptions['hostHeader']
- self.ExpectedBody = self.localOptions['ExpectedBody']
- self.DomainName = 'https://' + self.DomainName
+ self.expectedBody = self.localOptions['expectedBody']
+ self.domainName = 'https://' + self.domainName
def test_meek_response(self):
"""
Detects if the fronted request is blocked.
"""
log.msg("Testing fronted domain:%s with Host Header:%s"
- % (self.DomainName, self.header))
+ % (self.domainName, self.header))
def process_body(body):
- if self.ExpectedBody != body:
+ if self.expectedBody != body:
self.report['success'] = False
else:
self.report['success'] = True
headers = {}
headers['Host'] = [self.header]
- return self.doRequest(self.DomainName, method="GET", headers=headers,
+ return self.doRequest(self.domainName, method="GET", headers=headers,
body_processor=process_body)
More information about the tor-commits
mailing list