Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
test_misc.TestUnwrap Class Reference

List of all members.

Public Member Functions

def testUnwrap

Detailed Description

Definition at line 211 of file

Member Function Documentation

Definition at line 213 of file

00214     def testUnwrap(self):
00215         # First test that a Python object can be unwrapped.
00216         ob = xpcom.components.classes["Python.TestComponent"].createInstance()
00217         pyob = xpcom.server.UnwrapObject(ob)
00218         # This depends on our __repr__ implementation, but that's OK - it
00219         # can be updated should our __repr__ change :)
00220         self.failUnless(str(pyob).startswith("<component:py_test_component.PythonTestComponent"))
00221         # Test that a non-Python implemented object can NOT be unwrapped.
00222         ob = get_sample_component_cpp()
00223         if ob is None:
00224             return
00225         self.failUnlessRaises(ValueError, xpcom.server.UnwrapObject, ob)

Here is the call graph for this function:

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