Back to index

enigmail  1.4.3
Public Member Functions | Public Attributes
runtests.TestXPTLink Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def gettempfile
def test_xpt_link

Public Attributes

 tempdir

Detailed Description

Definition at line 749 of file runtests.py.


Member Function Documentation

Definition at line 756 of file runtests.py.

00756 
00757     def gettempfile(self):
00758         fd, f = tempfile.mkstemp(dir=self.tempdir)
00759         os.close(fd)
00760         return f

Here is the caller graph for this function:

Definition at line 750 of file runtests.py.

00750 
00751     def setUp(self):
00752         self.tempdir = tempfile.mkdtemp()

Definition at line 753 of file runtests.py.

00753 
00754     def tearDown(self):
00755         shutil.rmtree(self.tempdir, True)

Test the xpt_link method.

Definition at line 761 of file runtests.py.

00761 
00762     def test_xpt_link(self):
00763         """
00764         Test the xpt_link method.
00765         
00766         """
00767         t1 = xpt.Typelib()
00768         # add an unresolved interface
00769         t1.interfaces.append(xpt.Interface("IFoo"))
00770         f1 = self.gettempfile()
00771         t1.write(f1)
00772 
00773         t2 = xpt.Typelib()
00774         # add an unresolved interface
00775         t2.interfaces.append(xpt.Interface("IBar"))
00776         f2 = self.gettempfile()
00777         t2.write(f2)
00778 
00779         f3 = self.gettempfile()
00780         xpt.xpt_link(f3, [f1, f2])
00781         t3 = xpt.Typelib.read(f3)
00782         
00783         self.assertEqual(2, len(t3.interfaces))
00784         # Interfaces should wind up sorted
00785         self.assertEqual("IBar", t3.interfaces[0].name)
00786         self.assertEqual("IFoo", t3.interfaces[1].name)
00787 
00788         # Add some IID values
00789         t1 = xpt.Typelib()
00790         # add an unresolved interface
00791         t1.interfaces.append(xpt.Interface("IFoo", iid="11223344-5566-7788-9900-aabbccddeeff"))
00792         f1 = self.gettempfile()
00793         t1.write(f1)
00794 
00795         t2 = xpt.Typelib()
00796         # add an unresolved interface
00797         t2.interfaces.append(xpt.Interface("IBar", iid="44332211-6655-8877-0099-aabbccddeeff"))
00798         f2 = self.gettempfile()
00799         t2.write(f2)
00800 
00801         f3 = self.gettempfile()
00802         xpt.xpt_link(f3, [f1, f2])
00803         t3 = xpt.Typelib.read(f3)
00804         
00805         self.assertEqual(2, len(t3.interfaces))
00806         # Interfaces should wind up sorted
00807         self.assertEqual("IFoo", t3.interfaces[0].name)
00808         self.assertEqual("IBar", t3.interfaces[1].name)

Here is the call graph for this function:


Member Data Documentation

Definition at line 751 of file runtests.py.


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