~veebers/autopilot/move-testing-process-run-fixture

« back to all changes in this revision

Viewing changes to autopilot/testcase.py

  • Committer: Tarmac
  • Author(s): Christopher Lee
  • Date: 2014-07-09 00:01:19 UTC
  • mfrom: (497.1.6 fix_non-unit_unit_tests)
  • Revision ID: tarmac-20140709000119-fu9zk8dl7qjh2epo
Remove use of AutopilotTestCase in unit tests. Made some 'unit' tests functional tests.

Approved by Thomi Richards, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
 
58
58
from autopilot.application import (
59
59
    ClickApplicationLauncher,
60
 
    get_application_launcher_wrapper,
61
60
    NormalApplicationLauncher,
62
61
    UpstartApplicationLauncher,
63
62
)
246
245
         data is retrievable via this object.
247
246
 
248
247
        """
249
 
        launch_args = {}
250
 
        launch_arg_list = ['app_type', 'launch_dir', 'capture_output']
251
 
        for arg in launch_arg_list:
252
 
            if arg in kwargs:
253
 
                launch_args[arg] = kwargs.pop(arg)
 
248
        launch_args = _get_application_launch_args(kwargs)
 
249
 
254
250
        launcher = self.useFixture(
255
251
            NormalApplicationLauncher(
256
252
                case_addDetail=self.addDetailUniqueName,
425
421
 
426
422
    assertProperties = assertProperty
427
423
 
428
 
    @deprecated(
429
 
        "the 'app_type' argument to the launch_test_application method"
430
 
    )
431
 
    def pick_app_launcher(self, app_path):
432
 
        """Given an application path, return an object suitable for launching
433
 
        the application.
434
 
 
435
 
        This function attempts to guess what kind of application you are
436
 
        launching. If, for some reason the default implementation returns the
437
 
        wrong launcher, test authors may override this method to provide their
438
 
        own implemetnation.
439
 
 
440
 
        The default implementation calls
441
 
        :py:func:`autopilot.application.get_application_launcher_wrapper`
442
 
 
443
 
        """
444
 
        # default implementation is in autopilot.application:
445
 
        return get_application_launcher_wrapper(app_path)
 
424
 
 
425
def _get_application_launch_args(kwargs):
 
426
    """Returns a dict containing relevant args and values for launching an
 
427
    application.
 
428
 
 
429
    Removes used arguments from kwargs parameter.
 
430
 
 
431
    """
 
432
    launch_args = {}
 
433
    launch_arg_list = ['app_type', 'launch_dir', 'capture_output']
 
434
    for arg in launch_arg_list:
 
435
        if arg in kwargs:
 
436
            launch_args[arg] = kwargs.pop(arg)
 
437
    return launch_args
446
438
 
447
439
 
448
440
def _get_process_snapshot():