summaryrefslogtreecommitdiffstats
path: root/python/samba/tests
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2014-06-02 02:53:01 +0200
committerAndrew Bartlett <abartlet@samba.org>2014-10-14 06:44:06 +0200
commit0c2408531709eb720a2e96f72afbc2ecbfe6b06d (patch)
tree119c0fdcd4da3f53f32a77f2e0389057e1ca9030 /python/samba/tests
parent9a014d265b4e134fb5cea12aaca88ba5eb91cc05 (diff)
downloadsamba-0c2408531709eb720a2e96f72afbc2ecbfe6b06d.tar.gz
samba-0c2408531709eb720a2e96f72afbc2ecbfe6b06d.tar.xz
samba-0c2408531709eb720a2e96f72afbc2ecbfe6b06d.zip
Fix more pep8 issues in code I touched recently.
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Change-Id: I35f3204bdf5d00b3280d703427ded2fa2163a6f7
Diffstat (limited to 'python/samba/tests')
-rw-r--r--python/samba/tests/dns.py11
-rw-r--r--python/samba/tests/samba3sam.py6
-rw-r--r--python/samba/tests/source.py19
3 files changed, 18 insertions, 18 deletions
diff --git a/python/samba/tests/dns.py b/python/samba/tests/dns.py
index 303e93a028..34edf6b66e 100644
--- a/python/samba/tests/dns.py
+++ b/python/samba/tests/dns.py
@@ -127,13 +127,14 @@ class DNSTest(TestCase):
N = 0
result = ''
while src:
- s,src = src[:length],src[length:]
- hexa = ' '.join(["%02X"%ord(x) for x in s])
- s = s.translate(FILTER)
- result += "%04X %-*s %s\n" % (N, length*3, hexa, s)
- N+=length
+ s, src = src[:length], src[length:]
+ hexa = ' '.join(["%02X" % ord(x) for x in s])
+ s = s.translate(FILTER)
+ result += "%04X %-*s %s\n" % (N, length*3, hexa, s)
+ N += length
return result
+
class TestSimpleQueries(DNSTest):
def test_one_a_query(self):
diff --git a/python/samba/tests/samba3sam.py b/python/samba/tests/samba3sam.py
index 7cd656670a..d4347cd52c 100644
--- a/python/samba/tests/samba3sam.py
+++ b/python/samba/tests/samba3sam.py
@@ -186,12 +186,12 @@ class Samba3SamTestCase(MapBaseTestCase):
def test_s3sam_modify(self):
# Adding a record that will be fallbacked
- self.ldb.add({"dn": "cn=Foo",
+ self.ldb.add({
+ "dn": "cn=Foo",
"foo": "bar",
"blah": "Blie",
"cn": "Foo",
- "showInAdvancedViewOnly": "TRUE"}
- )
+ "showInAdvancedViewOnly": "TRUE"})
# Checking for existence of record (local)
# TODO: This record must be searched in the local database, which is
diff --git a/python/samba/tests/source.py b/python/samba/tests/source.py
index 2612ae68cf..3910acd85d 100644
--- a/python/samba/tests/source.py
+++ b/python/samba/tests/source.py
@@ -98,10 +98,9 @@ class TestSource(TestCase):
incorrect.append((fname, 'no copyright line found\n'))
if incorrect:
- help_text = ["Some files have missing or incorrect copyright"
- " statements.",
- "",
- ]
+ help_text = [
+ "Some files have missing or incorrect copyright"
+ " statements.", ""]
for fname, comment in incorrect:
help_text.append(fname)
help_text.append((' ' * 4) + comment)
@@ -230,18 +229,19 @@ class TestSource(TestCase):
'E203', # whitespace before ':'
'E222', # multiple spaces after operator
'E301', # expected 1 blank line, found 0
- 'E211', # whitespace before '('
- 'E701', # multiple statements on one line (colon)
]
def test_pep8(self):
pep8.process_options()
- pep8.options.repeat = True
pep8_errors = []
+ pep8_error_count = {}
pep8_warnings = []
for fname, text in get_source_file_contents():
def report_error(line_number, offset, text, check):
code = text[:4]
+ if code not in pep8_error_count:
+ pep8_error_count[code] = 0
+ pep8_error_count[code] += 1
if code in self.pep8_ignore:
code = 'W' + code[1:]
text = code + text[4:]
@@ -259,6 +259,5 @@ class TestSource(TestCase):
d = {}
for (fname, line_no, offset, text, check) in pep8_errors:
d.setdefault(fname, []).append(line_no - 1)
- self.fail(self._format_message(d,
- 'There were %d PEP8 errors:' % len(pep8_errors)))
-
+ self.fail(self._format_message(
+ d, 'There were %d PEP8 errors:' % len(pep8_errors)))