diff --git a/src/sugar3/test/unittest.py b/src/sugar3/test/unittest.py index dfd55437..d3e65ee2 100644 --- a/src/sugar3/test/unittest.py +++ b/src/sugar3/test/unittest.py @@ -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