summaryrefslogtreecommitdiff
path: root/Lib/test/test_binhex.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2011-03-16 22:11:09 -0400
committerNick Coghlan <ncoghlan@gmail.com>2011-03-16 22:11:09 -0400
commitbab07a652d811f2621538ffed6c46a41be2da888 (patch)
treefdc4fb419aec17f4db492c06e0b97955dbaf7057 /Lib/test/test_binhex.py
parentc9dacc27cfdd45d80c5d6c4a2e481df7042be0c5 (diff)
parentb52c0be4d284782475a96ce070075b5e912bccaf (diff)
downloadcpython-git-bab07a652d811f2621538ffed6c46a41be2da888.tar.gz
Tidy up merge with remote
Diffstat (limited to 'Lib/test/test_binhex.py')
-rwxr-xr-xLib/test/test_binhex.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_binhex.py b/Lib/test/test_binhex.py
index d6ef84a5e0..a807bca639 100755
--- a/Lib/test/test_binhex.py
+++ b/Lib/test/test_binhex.py
@@ -15,10 +15,12 @@ class BinHexTestCase(unittest.TestCase):
def setUp(self):
self.fname1 = support.TESTFN + "1"
self.fname2 = support.TESTFN + "2"
+ self.fname3 = support.TESTFN + "very_long_filename__very_long_filename__very_long_filename__very_long_filename__"
def tearDown(self):
support.unlink(self.fname1)
support.unlink(self.fname2)
+ support.unlink(self.fname3)
DATA = b'Jack is my hero'
@@ -37,6 +39,15 @@ class BinHexTestCase(unittest.TestCase):
self.assertEqual(self.DATA, finish)
+ def test_binhex_error_on_long_filename(self):
+ """
+ The testcase fails if no exception is raised when a filename parameter provided to binhex.binhex()
+ is too long, or if the exception raised in binhex.binhex() is not an instance of binhex.Error.
+ """
+ f3 = open(self.fname3, 'wb')
+ f3.close()
+
+ self.assertRaises(binhex.Error, binhex.binhex, self.fname3, self.fname2)
def test_main():
support.run_unittest(BinHexTestCase)