2 """Test script for the binhex C module
4 Uses the mechanism of the python binhex module
5 Based on an original test by Roger E. Masse.
10 from test
import test_support
13 class BinHexTestCase(unittest
.TestCase
):
16 self
.fname1
= test_support
.TESTFN
+ "1"
17 self
.fname2
= test_support
.TESTFN
+ "2"
20 try: os
.unlink(self
.fname1
)
23 try: os
.unlink(self
.fname2
)
26 DATA
= 'Jack is my hero'
28 def test_binhex(self
):
29 f
= open(self
.fname1
, 'w')
33 binhex
.binhex(self
.fname1
, self
.fname2
)
35 binhex
.hexbin(self
.fname2
, self
.fname1
)
37 f
= open(self
.fname1
, 'r')
41 self
.assertEqual(self
.DATA
, finish
)
45 test_support
.run_unittest(BinHexTestCase
)
48 if __name__
== "__main__":