~samuel-buffet/entertainer/bug_404372

« back to all changes in this revision

Viewing changes to entertainerlib/tests/test_mediaplayer.py

  • Committer: Tarmac
  • Author(s): Samuel Buffet
  • Date: 2009-07-13 15:14:06 UTC
  • mfrom: (394.1.2 pokes)
  • Revision ID: paul@eventuallyanyway.com-20090713151406-oo27ezmw81289o59
Change in variable names on the VolumeIndicator Class. (Samuel Buffet)

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
THIS_DIR = os.path.dirname(__file__)
12
12
 
13
13
class MediaPlayerTest(EntertainerTest):
14
 
    """Test for entertainerlib.frontend.gui.widgets.volume_indicator"""
 
14
    """Test for entertainerlib.frontend.gui.widgets.media_player"""
15
15
 
16
16
    def setUp(self):
17
17
        '''Set up the test.'''
36
36
        self.player.volume = -10
37
37
        self.assertEqual(self.player.volume, 0)
38
38
 
39
 
    def test_volumedown(self):
 
39
    def test_volume_down(self):
40
40
        '''Test the use of the volume_down method.'''
41
41
        self.player.volume = 10
42
42
        self.player.volume_down()
43
43
        self.assertEqual(self.player.volume, 9)
44
44
 
45
 
    def test_volumeup(self):
 
45
    def test_volume_up(self):
46
46
        '''Test the use of the volume_up method.'''
47
47
        self.player.volume = 10
48
48
        self.player.volume_up()
49
49
        self.assertEqual(self.player.volume, 11)
50
50
 
51
 
    def test_setmedia(self):
 
51
    def test_set_media(self):
52
52
        '''Test the use of the set_media method.'''
53
53
        # The method is called during setUp.
54
54
        self.assertTrue(self.player.media is not None)
55
55
 
56
 
    def test_getmedia(self):
 
56
    def test_get_media(self):
57
57
        '''Test the use of the get_media method.'''
58
58
        self.assertEqual(self.player.get_media(), self.video_item)
59
59
 
60
 
    def test_hasmedia(self):
 
60
    def test_has_media(self):
61
61
        '''Test the use of the has_media method.'''
62
62
        self.assertTrue(self.player.has_media())
63
63
 
66
66
        self.assertEqual(self.player.get_media_type(),
67
67
            self.video_item.get_type())
68
68
 
69
 
    def test_playstop(self):
 
69
    def test_play_stop(self):
70
70
        '''Test the use of the play and stop methods.'''
71
71
        self.player.play()
72
72
        self.assertTrue(self.player.is_playing)
73
73
        self.player.stop()
74
74
        self.assertFalse(self.player.is_playing)
75
75
 
76
 
    def test_getmediatitle(self):
 
76
    def test_get_media_title(self):
77
77
        '''Test the use of the get_media_title method.'''
78
78
        self.assertEqual(self.player.get_media_title(),
79
79
            THIS_DIR + '/data/VideoThumbnailer/test.avi')
80
80
 
81
 
    def test_getmediadurationstring(self):
 
81
    def test_get_media_duration_string(self):
82
82
        '''Test the use of the get_media_title method.'''
83
83
        self.assertEqual(self.player.get_media_duration_string(), "00:00")
84
84