From 7455ca36c57180b7d8481d6c5f9ef526e5c2207b Mon Sep 17 00:00:00 2001 From: Omer Katz Date: Tue, 23 Aug 2022 16:27:41 +0300 Subject: [PATCH] Run autopep8 to format the code --- testcontainers/arangodb.py | 1 + testcontainers/compose.py | 1 + testcontainers/elasticsearch.py | 1 + testcontainers/google/pubsub.py | 1 + testcontainers/keycloak.py | 12 ++++++------ testcontainers/mssql.py | 1 + testcontainers/mysql.py | 1 + testcontainers/oracle.py | 1 + testcontainers/selenium.py | 1 + tests/test_nginx.py | 4 ++-- 10 files changed, 16 insertions(+), 8 deletions(-) diff --git a/testcontainers/arangodb.py b/testcontainers/arangodb.py index ec4f005ea..0ab82ef4a 100644 --- a/testcontainers/arangodb.py +++ b/testcontainers/arangodb.py @@ -28,6 +28,7 @@ class ArangoDbContainer(DbContainer): # Create a new database named "test". sys_db.create_database("test") """ + def __init__(self, image: str = "arangodb:latest", port_to_expose: int = 8529, diff --git a/testcontainers/compose.py b/testcontainers/compose.py index 1cac63af8..b5961aa81 100644 --- a/testcontainers/compose.py +++ b/testcontainers/compose.py @@ -67,6 +67,7 @@ class DockerCompose(object): expose: - "5555" """ + def __init__( self, filepath, diff --git a/testcontainers/elasticsearch.py b/testcontainers/elasticsearch.py index 6b6f24b35..458d4e448 100644 --- a/testcontainers/elasticsearch.py +++ b/testcontainers/elasticsearch.py @@ -67,6 +67,7 @@ class ElasticSearchContainer(DockerContainer): with ElasticSearchContainer() as es: connection_url = es.get_url() """ + def __init__(self, image="elasticsearch", port_to_expose=9200, **kwargs): super(ElasticSearchContainer, self).__init__(image, **kwargs) self.port_to_expose = port_to_expose diff --git a/testcontainers/google/pubsub.py b/testcontainers/google/pubsub.py index 0400e3668..e4074dccd 100644 --- a/testcontainers/google/pubsub.py +++ b/testcontainers/google/pubsub.py @@ -33,6 +33,7 @@ def test_docker_run_pubsub(): topic_path = publisher.topic_path(pubsub.project, "my-topic") topic = publisher.create_topic(topic_path) """ + def __init__(self, image="google/cloud-sdk:latest", project="test-project", port=8432, **kwargs): super(PubSubContainer, self).__init__(image=image, **kwargs) diff --git a/testcontainers/keycloak.py b/testcontainers/keycloak.py index 5f03e238c..05e876d0d 100644 --- a/testcontainers/keycloak.py +++ b/testcontainers/keycloak.py @@ -61,12 +61,12 @@ def start(self): def get_client(self, **kwargs): default_kwargs = dict( - server_url="{}/auth/".format(self.get_url()), - username=self.KEYCLOAK_USER, - password=self.KEYCLOAK_PASSWORD, - realm_name="master", - verify=True, - ) + server_url="{}/auth/".format(self.get_url()), + username=self.KEYCLOAK_USER, + password=self.KEYCLOAK_PASSWORD, + realm_name="master", + verify=True, + ) kwargs = { **default_kwargs, **kwargs diff --git a/testcontainers/mssql.py b/testcontainers/mssql.py index f41fa57b4..e3a10276b 100644 --- a/testcontainers/mssql.py +++ b/testcontainers/mssql.py @@ -20,6 +20,7 @@ class SqlServerContainer(DbContainer): Requires `ODBC Driver 17 for SQL Server `_. """ + def __init__(self, image="mcr.microsoft.com/mssql/server:2019-latest", user="SA", password=None, port=1433, dbname="tempdb", dialect='mssql+pymssql', **kwargs): super(SqlServerContainer, self).__init__(image, **kwargs) diff --git a/testcontainers/mysql.py b/testcontainers/mysql.py index 8570589f8..ca9c3790e 100644 --- a/testcontainers/mysql.py +++ b/testcontainers/mysql.py @@ -33,6 +33,7 @@ class MySqlContainer(DbContainer): result = e.execute("select version()") version, = result.fetchone() """ + def __init__(self, image="mysql:latest", **kwargs): super(MySqlContainer, self).__init__(image) self.port_to_expose = 3306 diff --git a/testcontainers/oracle.py b/testcontainers/oracle.py index b8a426445..341aaa108 100644 --- a/testcontainers/oracle.py +++ b/testcontainers/oracle.py @@ -13,6 +13,7 @@ class OracleDbContainer(DbContainer): e = sqlalchemy.create_engine(oracle.get_connection_url()) result = e.execute("select 1 from dual") """ + def __init__(self, image="wnameless/oracle-xe-11g-r2:latest", **kwargs): super(OracleDbContainer, self).__init__(image=image, **kwargs) self.container_port = 1521 diff --git a/testcontainers/selenium.py b/testcontainers/selenium.py index f9b96753e..34843e76e 100644 --- a/testcontainers/selenium.py +++ b/testcontainers/selenium.py @@ -49,6 +49,7 @@ class BrowserWebDriverContainer(DockerContainer): You can easily change browser by passing :code:`DesiredCapabilities.FIREFOX` instead. """ + def __init__(self, capabilities, image=None, **kwargs): self.capabilities = capabilities self.image = image or get_image_name(capabilities) diff --git a/tests/test_nginx.py b/tests/test_nginx.py index e2af43932..cd4d68ca7 100644 --- a/tests/test_nginx.py +++ b/tests/test_nginx.py @@ -10,5 +10,5 @@ def test_docker_run_nginx(): url = "http://{}:{}/".format(nginx.get_container_host_ip(), nginx.get_exposed_port(port)) r = requests.get(url) - assert(r.status_code == 200) - assert('Welcome to nginx!' in r.text) + assert (r.status_code == 200) + assert ('Welcome to nginx!' in r.text)