Skip to content

Commit ab9d310

Browse files
author
Sakari Rautiainen
authored
Merge pull request #55 from bitbar/devel
v2.6.3
2 parents e771b61 + f053877 commit ab9d310

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys, os
44

55

6-
version = '2.6.2'
6+
version = '2.6.3'
77

88
setup(name='testdroid',
99
version=version,

testdroid/__init__.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from optparse import OptionParser
66
from datetime import datetime
77

8-
__version__ = '2.6.2'
8+
__version__ = '2.6.3'
99

1010
FORMAT = "%(message)s"
1111
logging.basicConfig(format=FORMAT)
@@ -549,6 +549,14 @@ def get_device_runs(self, project_id, test_run_id, limit=0):
549549
def get_device_run_screenshots_list(self, project_id, test_run_id, device_run_id, limit=0):
550550
return self.get("me/projects/%s/runs/%s/device-runs/%s/screenshots" % (project_id, test_run_id, device_run_id), payload = {'limit': limit})
551551

552+
""" Get list of files for device run
553+
"""
554+
def get_device_run_files(self, project_id, test_run_id, device_session_id, tags=None):
555+
if tags is None:
556+
return self.get("me/projects/%s/runs/%s/device-sessions/%s/output-file-set/files" % (project_id, test_run_id, device_session_id))
557+
else:
558+
return self.get("me/projects/%s/runs/%s/device-sessions/%s/output-file-set/files?tag[]=%s" % (project_id, test_run_id, device_session_id, tags))
559+
552560
""" Downloads test run files to a directory hierarchy
553561
"""
554562
def download_test_run(self, project_id, test_run_id):
@@ -566,7 +574,7 @@ def download_test_run(self, project_id, test_run_id):
566574
if run_status in ("SUCCEEDED", "FAILED", "EXCLUDED"):
567575
directory = "%s-%s/%d-%s" % (test_run_id, test_run['displayName'], device_run['id'], device_run['device']['displayName'])
568576
session_id = device_run['deviceSessionId']
569-
files = self.get("me/projects/%s/runs/%s/device-sessions/%s/output-file-set/files" % (project_id, test_run_id, session_id))
577+
files = self.get_device_run_files(project_id, test_run_id, session_id)
570578
for file in files['data']:
571579
if file['state'] == "READY":
572580
full_path = "%s/%s" % (directory, file['name'])
@@ -713,6 +721,7 @@ def get_commands(self):
713721
"test-run": self.get_test_run,
714722
"test-runs": self.print_project_test_runs,
715723
"device-runs": self.get_device_runs,
724+
"device-run-files": self.get_device_run_files,
716725
"download-test-run": self.download_test_run,
717726
"download-test-screenshots": self.download_test_screenshots
718727
}

0 commit comments

Comments
 (0)