mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #12287: In ossaudiodev, check that the device isn't closed in several
methods.
This commit is contained in:
parent
d8649b1a1a
commit
a529308348
3 changed files with 110 additions and 0 deletions
|
@ -170,6 +170,22 @@ class OSSAudioDevTests(unittest.TestCase):
|
|||
pass
|
||||
self.assertTrue(dsp.closed)
|
||||
|
||||
def test_on_closed(self):
|
||||
dsp = ossaudiodev.open('w')
|
||||
dsp.close()
|
||||
self.assertRaises(ValueError, dsp.fileno)
|
||||
self.assertRaises(ValueError, dsp.read, 1)
|
||||
self.assertRaises(ValueError, dsp.write, b'x')
|
||||
self.assertRaises(ValueError, dsp.writeall, b'x')
|
||||
self.assertRaises(ValueError, dsp.bufsize)
|
||||
self.assertRaises(ValueError, dsp.obufcount)
|
||||
self.assertRaises(ValueError, dsp.obufcount)
|
||||
self.assertRaises(ValueError, dsp.obuffree)
|
||||
self.assertRaises(ValueError, dsp.getptr)
|
||||
|
||||
mixer = ossaudiodev.openmixer()
|
||||
mixer.close()
|
||||
self.assertRaises(ValueError, mixer.fileno)
|
||||
|
||||
def test_main():
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue