Skip to content

Commit 66b6be4

Browse files
author
Sakari Rautiainen
authored
Merge pull request #47 from jwallis/feature_constructor
Fix constructor overloading
2 parents c17a12e + e4e6b48 commit 66b6be4

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

testdroid/__init__.py

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -100,25 +100,14 @@ class Testdroid:
100100
# polling interval when awaiting for test run completion
101101
polling_interval_mins = 10
102102

103-
""" Simple constructor, defaults against cloud.testdroid.com
104-
"""
105-
def __init__(self):
106-
self.cloud_url="https://cloud.testdroid.com"
107-
108-
""" Full constructor with username and password
109-
"""
110-
def __init__(self, username=None, password=None, url="https://cloud.testdroid.com", download_buffer_size=65536):
111-
self.username = username
112-
self.password = password
113-
self.cloud_url = url
114-
self.download_buffer_size = download_buffer_size
115-
116-
""" Full constructor with api key
117-
"""
118-
def __init__(self, apikey=None, url="https://cloud.testdroid.com", download_buffer_size=65536):
119-
self.api_key = apikey
120-
self.cloud_url = url
121-
self.download_buffer_size = download_buffer_size
103+
""" Constructor, defaults against cloud.testdroid.com
104+
"""
105+
def __init__(self, **kwargs):
106+
self.api_key = kwargs.get('apikey')
107+
self.username = kwargs.get('username')
108+
self.password = kwargs.get('password')
109+
self.cloud_url = kwargs.get('url') or "https://cloud.testdroid.com"
110+
self.download_buffer_size = kwargs.get('download_buffer_size') or 65536
122111

123112
def set_apikey(self, apikey):
124113
self.api_key = apikey

0 commit comments

Comments
 (0)