Add a testing method to open a activity with a uri
This can be used in the test to check if the activity can manage different file formats.
This commit is contained in:
parent
f48c3247f6
commit
952b8275a1
@ -63,9 +63,19 @@ class UITestCase(unittest.TestCase):
|
||||
process.terminate()
|
||||
|
||||
@contextmanager
|
||||
def run_activity(self):
|
||||
def run_activity(self, options=None):
|
||||
self._run_activity(options)
|
||||
|
||||
@contextmanager
|
||||
def run_activity_with_uri(self, uri):
|
||||
self._run_activity(['--uri', uri])
|
||||
|
||||
def _run_activity(self, options=None):
|
||||
if self.bundle_id is not None:
|
||||
process = subprocess.Popen(["sugar-launch", self.bundle_id])
|
||||
cmd = ["sugar-launch", self.bundle_id]
|
||||
if options is not None:
|
||||
cmd += options
|
||||
process = subprocess.Popen(cmd)
|
||||
else:
|
||||
print "No bundle_id specified."
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user