Skip to content

Commit 6467826

Browse files
Merge pull request #40 from Ankit098/fix/false_bool_argument
fix: handle false value in boolean arguments
2 parents ec45056 + c333f8a commit 6467826

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

browserstack/local.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ def __xstr(self, key, value):
1313
return ['']
1414
if str(value).lower() == "true":
1515
return ['-' + key]
16+
elif str(value).lower() == "false":
17+
return ['']
1618
else:
1719
return ['-' + key, value]
1820

tests/test_local.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ def test_custom_boolean_argument(self):
5353
self.assertIn('-boolArg1', self.local._generate_cmd())
5454
self.assertIn('-boolArg2', self.local._generate_cmd())
5555

56+
def test_custom_boolean_argument_false(self):
57+
self.local.start(boolArg1=False, boolArg2=False, onlyCommand=True)
58+
self.assertNotIn('-boolArg1', self.local._generate_cmd())
59+
self.assertNotIn('-boolArg2', self.local._generate_cmd())
60+
5661
def test_custom_keyval(self):
5762
self.local.start(customKey1="custom value1", customKey2="custom value2", onlyCommand=True)
5863
self.assertIn('-customKey1', self.local._generate_cmd())

0 commit comments

Comments
 (0)