Skip to content

Commit 29c05eb

Browse files
committed
re-enable test
1 parent 2c0d4f3 commit 29c05eb

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

browserstack/local.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ def start(self, **kwargs):
5353

5454
os.system('echo "" > "'+ self.local_logfile_path +'"')
5555
try:
56-
data = json.loads(out if out else err)
56+
if err:
57+
data = json.loads(err)
58+
else:
59+
data = json.loads(out)
5760

5861
if data['state'] != "connected":
5962
raise BrowserStackLocalError(data["message"])

tests/test_local.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ def test_running(self):
1717
self.local.start()
1818
self.assertTrue(self.local.isRunning())
1919

20-
# def test_multiple(self):
21-
# self.assertFalse(self.local.isRunning())
22-
# self.local.start()
23-
# self.assertTrue(self.local.isRunning())
24-
# try:
25-
# self.local2 = Local(os.environ['BROWSERSTACK_ACCESS_KEY'])
26-
# self.local2.start()
27-
# except BrowserStackLocalError as e:
28-
# self.assertEqual(e.message, "Either another browserstack local client is running on your machine or some server is listening on port 45691")
20+
def test_multiple(self):
21+
self.assertFalse(self.local.isRunning())
22+
self.local.start()
23+
self.assertTrue(self.local.isRunning())
24+
try:
25+
self.local2 = Local(os.environ['BROWSERSTACK_ACCESS_KEY'])
26+
self.local2.start()
27+
except BrowserStackLocalError as e:
28+
self.assertEqual(e.message, "Either another browserstack local client is running on your machine or some server is listening on port 45691")
2929

3030
def test_verbose(self):
3131
self.local.start(v=True, onlyCommand=True)

0 commit comments

Comments
 (0)