~ubuntu-branches/ubuntu/saucy/mago/saucy

« back to all changes in this revision

Viewing changes to totem/totem_basics.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
 
# -*- coding: utf-8 -*-
2
 
import os
3
 
from time import time, gmtime, strftime
4
 
 
5
 
from mago.test_suite.totem import TotemTestSuite 
6
 
 
7
 
class TotemBasics(TotemTestSuite):
8
 
    def check_audio_playback(self):
9
 
        test_file = strftime(
10
 
            "/tmp/" + "%Y%m%d_%H%M%S" + ".wav", gmtime((time())))
11
 
        self.application.openfile(self.wavfile)
12
 
        (freq, flat) = self.application.capture_do_fft(test_file)
13
 
        if freq != self.freq:
14
 
            raise AssertionError, "Sine WAV playback error, frq expected: %s ; got %s" % (self.freq, freq)
15
 
        self.application.play_pause()
16
 
        os.unlink(test_file)
17
 
        (freq, flat) = self.application.capture_do_fft(test_file)
18
 
        if flat != 1:
19
 
            raise AssertionError, "Pause playback error, non flat PCM detected"  
20
 
        self.application.play_pause()
21
 
        os.unlink(test_file)
22
 
if __name__ == "__main__":
23
 
    totem_test =  TotemBasics()
24
 
    totem_test.run()