[Merge] lp:~canonical-platform-qa/mediaplayer-app/fix1359040-skip_seekbar into lp:mediaplayer-app

Jim Hodapp jim.hodapp at canonical.com
Thu Sep 4 20:21:34 UTC 2014



Diff comments:

> === modified file 'tests/autopilot/mediaplayer_app/tests/test_player_with_video.py'
> --- tests/autopilot/mediaplayer_app/tests/test_player_with_video.py	2014-07-16 16:39:11 +0000
> +++ tests/autopilot/mediaplayer_app/tests/test_player_with_video.py	2014-09-04 06:13:17 +0000
> @@ -1,5 +1,5 @@
>  # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
> -# Copyright 2012 Canonical
> +# Copyright 2012, 2014 Canonical

Minor change, but just have this be a date range: 2012-2014

>  #
>  # This program is free software: you can redistribute it and/or modify it
>  # under the terms of the GNU General Public License version 3, as published
> @@ -7,16 +7,18 @@
>  
>  """Tests for the Mediaplayer App"""
>  
> +import logging
> +
> +from autopilot import platform
>  from autopilot.matchers import Eventually
> -from autopilot.platform import model
> -from testtools import skipIf
> -from testtools.matchers import Equals, GreaterThan
> -
> -from unittest import skip
> +from testtools.matchers import Equals
>  
>  from mediaplayer_app.tests import MediaplayerAppTestCase
>  
>  
> +logger = logging.getLogger(__name__)
> +
> +
>  class TestPlayerWithVideo(MediaplayerAppTestCase):
>      """Tests the main media player features while playing a video """
>  
> @@ -24,8 +26,8 @@
>          In the testfarm, the application may take some time to show up."""
>      def setUp(self):
>          super(TestPlayerWithVideo, self).setUp()
> -        print(model())
> -        if model() in (
> +        logger.info(platform.model())
> +        if platform.model() in (
>                  'Nexus 4', 'Galaxy Nexus', "Nexus 7 (2013) Wi-Fi", "Nexus 10"):
>              self.launch_app("h264.avi")
>          else:
> @@ -36,6 +38,9 @@
>          player = self.main_window.get_player()
>          self.assertThat(player.playing, Eventually(Equals(True)))
>  
> +    def has_seekbar(self):
> +        return platform.model() == 'Desktop' or platform.is_tablet()
> +
>      def show_controls(self):
>          video_area = self.main_window.get_video_area()
>          self.pointing_device.click_object(video_area)
> @@ -69,9 +74,9 @@
>          self.assertProperty(player, playing=True, paused=False)
>          self.assertProperty(playback_button, icon="pause")
>  
> -    @skipIf(model() in ('Nexus 4', 'Galaxy Nexus'),
> -            'Screen width not enough for seekbar')
>      def test_time_display_behavior(self):
> +        if not self.has_seekbar():
> +            self.skipTest('Screen width not enough for seekbar.')
>          self.show_controls()
>          self.pause_video()
>  
> @@ -92,9 +97,9 @@
>          # signal)
>          self.assertEqual(time_label.text[0:1], "-")
>  
> -    @skipIf(model() in ('Nexus 4', 'Galaxy Nexus'),
> -            'Screen width not enough for seekbar')
>      def test_show_controls_at_end(self):
> +        if not self.has_seekbar():
> +            self.skipTest('Screen width not enough for seekbar.')
>          controls = self.main_window.get_controls()
>          # The controls are invisible by default
>          self.assertThat(controls.visible, Eventually(Equals(False)))
> 


-- 
https://code.launchpad.net/~canonical-platform-qa/mediaplayer-app/fix1359040-skip_seekbar/+merge/231508
Your team Ubuntu Phablet Team is subscribed to branch lp:mediaplayer-app.



More information about the Ubuntu-reviews mailing list