Skip to content

Commit bbef9d6

Browse files
committed
python: adding support to tunnelOwner/tunnelName
1 parent bc8ba41 commit bbef9d6

File tree

5 files changed

+49
-1
lines changed

5 files changed

+49
-1
lines changed

python/saucebindings/configs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ class Configs:
77
'custom_data': 'customData',
88
'public': 'public',
99
'tunnel_identifier': 'tunnelIdentifier',
10+
'tunnel_name': 'tunnelName',
11+
'tunnel_owner': 'tunnelOwner',
1012
'parent_tunnel': 'parentTunnel'
1113
}
1214

python/saucebindings/options.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
'iedriver_version': 'iedriverVersion',
3232
'max_duration': 'maxDuration',
3333
'name': 'name',
34+
# parent_tunnel is deprecated and being replaced with tunnel_owner.
3435
'parent_tunnel': 'parentTunnel',
3536
'prerun': 'prerun',
3637
'priority': 'priority',
@@ -42,7 +43,10 @@
4243
'selenium_version': 'seleniumVersion',
4344
'tags': 'tags',
4445
'time_zone': 'timeZone',
46+
# tunnel_identifier is deprecated and being replaced with tunnel_name.
4547
'tunnel_identifier': 'tunnelIdentifier',
48+
'tunnel_name': 'tunnelName',
49+
'tunnel_owner': 'tunnelOwner',
4650
'video_upload_on_pass': 'videoUploadOnPass',
4751
'capture_performance': 'capturePerformance'
4852
}

python/tests/unit/test_chrome.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,20 @@ def test_accepts_sauce_values_with_dict(self):
117117
assert sauce.tunnel_identifier == 'foobar'
118118
assert sauce.video_upload_on_pass is False
119119

120+
def test_accepts_tunnel(self):
121+
options = {'build': 'bar',
122+
'idleTimeout': 3,
123+
'name': 'foo',
124+
'tunnelOwner': 'bar',
125+
'tunnelName': 'foobar'}
126+
127+
sauce = SauceOptions.chrome(**options)
128+
129+
assert sauce.build == 'bar'
130+
assert sauce.name == 'foo'
131+
assert sauce.tunnel_owner == 'bar'
132+
assert sauce.tunnel_name == 'foobar'
133+
120134
def test_accepts_sauce_values_as_params(self):
121135
custom_data = {'foo': 'foo',
122136
'bar': 'bar'}

python/tests/unit/test_edge.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,20 @@ def test_sauce_options(self):
293293
assert options.tunnel_identifier == 'tunnelname'
294294
assert options.video_upload_on_pass is False
295295

296+
def test_accepts_tunnel(self):
297+
options = {'build': 'bar',
298+
'idleTimeout': 3,
299+
'name': 'foo',
300+
'tunnelOwner': 'bar',
301+
'tunnelName': 'foobar'}
302+
303+
sauce = SauceOptions.edge(**options)
304+
305+
assert sauce.build == 'bar'
306+
assert sauce.name == 'foo'
307+
assert sauce.tunnel_owner == 'bar'
308+
assert sauce.tunnel_name == 'foobar'
309+
296310
def test_setting_browser_name(self):
297311
options = SauceOptions.edge()
298312

python/tests/unit/test_firefox.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def test_setting_capabilities(self):
352352
assert options.build == 'Sample Build Name'
353353
assert options.command_timeout == 2
354354
assert options.custom_data == custom_data
355-
assert options.extended_debugging == True
355+
assert options.extended_debugging is True
356356
assert options.idle_timeout == 3
357357
assert options.geckodriver_version == '0.23'
358358
assert options.max_duration == 300
@@ -487,3 +487,17 @@ def test_capabilities_for_selenium(self):
487487
}
488488

489489
assert options.to_capabilities() == expected_capabilities
490+
491+
def test_accepts_tunnel(self):
492+
options = {'build': 'bar',
493+
'idleTimeout': 3,
494+
'name': 'foo',
495+
'tunnelOwner': 'bar',
496+
'tunnelName': 'foobar'}
497+
498+
sauce = SauceOptions.firefox(**options)
499+
500+
assert sauce.build == 'bar'
501+
assert sauce.name == 'foo'
502+
assert sauce.tunnel_owner == 'bar'
503+
assert sauce.tunnel_name == 'foobar'

0 commit comments

Comments
 (0)