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

@ -1,10 +1,12 @@
import pytest
boto = pytest.importorskip("boto")
import unittest
import ansible.modules.cloud.amazon.s3 as s3
from ansible.module_utils.six.moves.urllib.parse import urlparse
boto = pytest.importorskip("boto")
class TestUrlparse(unittest.TestCase):
def test_urlparse(self):
@ -19,16 +21,16 @@ class TestUrlparse(unittest.TestCase):
def test_is_walrus(self):
actual = s3.is_walrus("trulywalrus_but_invalid_url")
#I don't know if this makes sense, but this is the current behaviour...
# I don't know if this makes sense, but this is the current behaviour...
self.assertEqual(True, actual)
actual = s3.is_walrus("http://notwalrus.amazonaws.com")
self.assertEqual(False, actual)
def test_get_s3_connection(self):
aws_connect_kwargs = dict(aws_access_key_id="access_key",
aws_secret_access_key="secret_key")
location=None
rgw=True
s3_url="http://bla.blubb"
aws_secret_access_key="secret_key")
location = None
rgw = True
s3_url = "http://bla.blubb"
actual = s3.get_s3_connection(aws_connect_kwargs, location, rgw, s3_url)
self.assertEqual("bla.blubb", actual.host)