~ubuntu-branches/ubuntu/natty/mago/natty

« back to all changes in this revision

Viewing changes to mago/test_suite/totem.py

  • Committer: Bazaar Package Importer
  • Author(s): Ara Pulido
  • Date: 2010-12-03 16:08:32 UTC
  • Revision ID: james.westby@ubuntu.com-20101203160832-97pz2nxwmo54iwfk
Tags: 0.3-0ubuntu3
* Updated from trunk
 + Added new applications to our tests base
 + Fixes LP: #682845 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""
 
2
This module contains the definition of the test suite for Totem testing.
 
3
"""
 
4
import ldtp, ooldtp
 
5
from .main import SingleApplicationTestSuite
 
6
from ..application.totem import Application, Totem
 
7
import pygst
 
8
pygst.require("0.10")
 
9
import gst
 
10
import os
 
11
 
 
12
class TotemTestSuite(SingleApplicationTestSuite):
 
13
    """
 
14
    Default test suite for Totem
 
15
    """
 
16
    APPLICATION_FACTORY = Totem
 
17
    wavfile = '/tmp/totem.wav'
 
18
    freq=440
 
19
    def setup(self):
 
20
        pipeline = 'audiotestsrc freq=%d num-buffers=512 ! queue ! \
 
21
        audioconvert ! \
 
22
        audio/x-raw-int,width=16,depth=16,channels=1 ! \
 
23
        wavenc ! \
 
24
        filesink location=%s' % (self.freq, self.wavfile)
 
25
        element = gst.parse_launch(pipeline)
 
26
        element.set_state(gst.STATE_PLAYING)
 
27
      
 
28
        self.application.open()
 
29
 
 
30
    def teardown(self):
 
31
        self.application.close()
 
32
        os.unlink(self.wavfile)
 
33
 
 
34
    def cleanup(self):
 
35
        self.application.close()