Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_wave.TestWave Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_it
def test_fractional_framerate
def test_issue7681

Public Attributes

 f

Detailed Description

Definition at line 12 of file test_wave.py.


Member Function Documentation

Definition at line 14 of file test_wave.py.

00014 
00015     def setUp(self):
00016         self.f = None

Here is the caller graph for this function:

Definition at line 17 of file test_wave.py.

00017 
00018     def tearDown(self):
00019         if self.f is not None:
00020             self.f.close()
00021         try:
00022             os.remove(TESTFN)
00023         except OSError:
00024             pass

Here is the caller graph for this function:

Addresses [ 1512791 ] module wave does no rounding
Floating point framerates should be rounded, rather than truncated.

Definition at line 45 of file test_wave.py.

00045 
00046     def test_fractional_framerate(self):
00047         """
00048         Addresses [ 1512791 ] module wave does no rounding
00049         Floating point framerates should be rounded, rather than truncated.
00050         """
00051         self.test_it(test_rounding=True)

Here is the call graph for this function:

Definition at line 52 of file test_wave.py.

00052 
00053     def test_issue7681(self):
00054         self.f = wave.open(TESTFN, 'wb')
00055         self.f.setnchannels(nchannels)
00056         self.f.setsampwidth(sampwidth)
00057         self.f.setframerate(framerate)
00058         # Don't call setnframes, make _write_header divide to figure it out
00059         output = b'\0' * nframes * nchannels * sampwidth
00060         self.f.writeframes(output)
00061 

Here is the call graph for this function:

def test.test_wave.TestWave.test_it (   self,
  test_rounding = False 
)

Definition at line 25 of file test_wave.py.

00025 
00026     def test_it(self, test_rounding=False):
00027         self.f = wave.open(TESTFN, 'wb')
00028         self.f.setnchannels(nchannels)
00029         self.f.setsampwidth(sampwidth)
00030         if test_rounding:
00031             self.f.setframerate(framerate - 0.1)
00032         else:
00033             self.f.setframerate(framerate)
00034         self.f.setnframes(nframes)
00035         output = b'\0' * nframes * nchannels * sampwidth
00036         self.f.writeframes(output)
00037         self.f.close()
00038 
00039         self.f = wave.open(TESTFN, 'rb')
00040         self.assertEqual(nchannels, self.f.getnchannels())
00041         self.assertEqual(sampwidth, self.f.getsampwidth())
00042         self.assertEqual(framerate, self.f.getframerate())
00043         self.assertEqual(nframes, self.f.getnframes())
00044         self.assertEqual(self.f.readframes(nframes), output)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 15 of file test_wave.py.


The documentation for this class was generated from the following file: