test/: PEP8 compliancy (#24803)

* test/: PEP8 compliancy

- Make PEP8 compliant

* Python3 chokes on casting int to bytes (#24952)

But if we tell the formatter that the var is a number, it works
This commit is contained in:
Dag Wieers 2017-05-30 19:05:19 +02:00 committed by John R Barker
parent 31c59ad5f9
commit 4efec414e7
110 changed files with 1702 additions and 1547 deletions

View file

@ -36,11 +36,8 @@ class KnownHostsDiffTestCase(unittest.TestCase):
self.assertEqual(diff, {
'before_header': path,
'after_header': path,
'before':
'two.example.com ssh-rsa BBBBetc\n',
'after':
'two.example.com ssh-rsa BBBBetc\n'
'one.example.com ssh-rsa AAAAetc\n',
'before': 'two.example.com ssh-rsa BBBBetc\n',
'after': 'two.example.com ssh-rsa BBBBetc\none.example.com ssh-rsa AAAAetc\n',
})
def test_no_change(self):
@ -53,12 +50,8 @@ class KnownHostsDiffTestCase(unittest.TestCase):
self.assertEqual(diff, {
'before_header': path,
'after_header': path,
'before':
'one.example.com ssh-rsa AAAAetc\n'
'two.example.com ssh-rsa BBBBetc\n',
'after':
'one.example.com ssh-rsa AAAAetc\n'
'two.example.com ssh-rsa BBBBetc\n',
'before': 'one.example.com ssh-rsa AAAAetc\ntwo.example.com ssh-rsa BBBBetc\n',
'after': 'one.example.com ssh-rsa AAAAetc\ntwo.example.com ssh-rsa BBBBetc\n',
})
def test_key_change(self):
@ -71,12 +64,8 @@ class KnownHostsDiffTestCase(unittest.TestCase):
self.assertEqual(diff, {
'before_header': path,
'after_header': path,
'before':
'one.example.com ssh-rsa AAAaetc\n'
'two.example.com ssh-rsa BBBBetc\n',
'after':
'two.example.com ssh-rsa BBBBetc\n'
'one.example.com ssh-rsa AAAAetc\n',
'before': 'one.example.com ssh-rsa AAAaetc\ntwo.example.com ssh-rsa BBBBetc\n',
'after': 'two.example.com ssh-rsa BBBBetc\none.example.com ssh-rsa AAAAetc\n',
})
def test_key_removal(self):
@ -89,11 +78,8 @@ class KnownHostsDiffTestCase(unittest.TestCase):
self.assertEqual(diff, {
'before_header': path,
'after_header': path,
'before':
'one.example.com ssh-rsa AAAAetc\n'
'two.example.com ssh-rsa BBBBetc\n',
'after':
'two.example.com ssh-rsa BBBBetc\n',
'before': 'one.example.com ssh-rsa AAAAetc\ntwo.example.com ssh-rsa BBBBetc\n',
'after': 'two.example.com ssh-rsa BBBBetc\n',
})
def test_key_removal_no_change(self):
@ -105,8 +91,6 @@ class KnownHostsDiffTestCase(unittest.TestCase):
self.assertEqual(diff, {
'before_header': path,
'after_header': path,
'before':
'two.example.com ssh-rsa BBBBetc\n',
'after':
'two.example.com ssh-rsa BBBBetc\n',
'before': 'two.example.com ssh-rsa BBBBetc\n',
'after': 'two.example.com ssh-rsa BBBBetc\n',
})