def test_calls_get_glib_loop(self, gpofep, ual):
     launcher = UpstartApplicationLauncher()
     with patch.object(launcher, '_launch_app'):
         with patch.object(launcher, '_get_pid_for_launched_app'):
             with patch.object(launcher, '_get_glib_loop') as ggl:
                 launcher.launch('')
                 ggl.assert_called_once_with()
 def test_calls_get_pid(self, gpofep, ual):
     launcher = UpstartApplicationLauncher()
     token = self.getUniqueString()
     with patch.object(launcher, '_launch_app'):
         with patch.object(launcher, '_get_pid_for_launched_app') as gp:
             with patch.object(launcher, '_get_glib_loop'):
                 launcher.launch(token)
                 gp.assert_called_once_with(token)
 def test_gets_correct_proxy_object(self, gpofep, ual):
     launcher = UpstartApplicationLauncher()
     with patch.object(launcher, '_launch_app'):
         with patch.object(launcher, '_get_pid_for_launched_app') as gp:
             with patch.object(launcher, '_get_glib_loop'):
                 launcher.launch('')
                 gpofep.assert_called_once_with(pid=gp.return_value,
                                                emulator_base=None,
                                                dbus_bus='session')
 def test_handle_list(self, gpofep, ual):
     launcher = UpstartApplicationLauncher()
     token_a = self.getUniqueString()
     token_b = self.getUniqueString()
     with patch.object(launcher, '_launch_app') as la:
         with patch.object(launcher, '_get_pid_for_launched_app'):
             with patch.object(launcher, '_get_glib_loop'):
                 launcher.launch(token_a, [token_b])
                 la.assert_called_once_with(token_a, [token_b])
 def test_returns_proxy_object(self, gpofep, ual):
     launcher = UpstartApplicationLauncher()
     with patch.object(launcher, '_launch_app'):
         with patch.object(launcher, '_get_pid_for_launched_app'):
             with patch.object(launcher, '_get_glib_loop'):
                 result = launcher.launch('')
                 self.assertEqual(result, gpofep.return_value)