~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): Michael Vogt
  • Date: 2011-02-08 13:32:13 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110208133213-m1og7ey0m990chg6
Tags: 0.3+bzr20-0ubuntu1
* debian/rules:
  - updated to debhelper 7
  - use dh_python2 instead of python-central
* debian/pycompat:
  - removed, no longer needed
* debian/control:
  - dropped cdbs and python-central dependencies
* bzr snapshot of the current trunk

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()