mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
TestMIMEAudio.setUp(): Use the email package's copy of the audio test
file, needed because some binary distros (read RPMs) don't include the test module in their standard Python package. This eliminates an external dependency and closes SF bug # 650441.
This commit is contained in:
parent
c99c08c764
commit
f29ffbdbf5
1 changed files with 7 additions and 2 deletions
|
|
@ -769,8 +769,13 @@ def test_dont_mangle_from(self):
|
|||
# Test the basic MIMEAudio class
|
||||
class TestMIMEAudio(unittest.TestCase):
|
||||
def setUp(self):
|
||||
# In Python, audiotest.au lives in Lib/test not Lib/test/data
|
||||
fp = open(findfile('audiotest.au'), 'rb')
|
||||
# Make sure we pick up the audiotest.au that lives in email/test/data.
|
||||
# In Python, there's an audiotest.au living in Lib/test but that isn't
|
||||
# included in some binary distros that don't include the test
|
||||
# package. The trailing empty string on the .join() is significant
|
||||
# since findfile() will do a dirname().
|
||||
datadir = os.path.join(os.path.dirname(landmark), 'data', '')
|
||||
fp = open(findfile('audiotest.au', datadir), 'rb')
|
||||
try:
|
||||
self._audiodata = fp.read()
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue