Back to index

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

List of all members.

Public Member Functions

def setUp
def testEmpty
def testForwardInterface
def testInterface
def testAttributes
def testMethod
def testMethodParams
def testAttribute

Public Attributes

 p

Detailed Description

Definition at line 10 of file runtests.py.


Member Function Documentation

def runtests.TestParser.setUp (   self)

Definition at line 11 of file runtests.py.

00011 
00012     def setUp(self):
00013         self.p = xpidl.IDLParser()
    

Definition at line 83 of file runtests.py.

00083 
00084     def testAttribute(self):
00085         i = self.p.parse("""[uuid(abc)] interface foo {
00086 attribute long bar;
00087 };""", filename='f')
00088         self.assertTrue(isinstance(i, xpidl.IDL))
00089         self.assertTrue(isinstance(i.productions[0], xpidl.Interface))
00090         iface = i.productions[0]
00091         a = iface.members[0]
00092         self.assertTrue(isinstance(a, xpidl.Attribute))
00093         self.assertEqual("bar", a.name)
00094         self.assertEqual("long", a.type)

Here is the call graph for this function:

Definition at line 31 of file runtests.py.

00031 
00032     def testAttributes(self):
00033         i = self.p.parse("[scriptable, builtinclass, function, deprecated, uuid(abc)] interface foo {};", filename='f')
00034         self.assertTrue(isinstance(i, xpidl.IDL))
00035         self.assertTrue(isinstance(i.productions[0], xpidl.Interface))
00036         iface = i.productions[0]
00037         self.assertEqual("foo", iface.name)
00038         self.assertTrue(iface.attributes.scriptable)
00039         self.assertTrue(iface.attributes.builtinclass)
00040         self.assertTrue(iface.attributes.function)
00041         self.assertTrue(iface.attributes.deprecated)
00042 
00043         i = self.p.parse("[noscript, uuid(abc)] interface foo {};", filename='f')
00044         self.assertTrue(isinstance(i, xpidl.IDL))
00045         self.assertTrue(isinstance(i.productions[0], xpidl.Interface))
00046         iface = i.productions[0]
00047         self.assertEqual("foo", iface.name)
00048         self.assertTrue(iface.attributes.noscript)

Here is the call graph for this function:

Definition at line 14 of file runtests.py.

00014 
00015     def testEmpty(self):
00016         i = self.p.parse("", filename='f')
00017         self.assertTrue(isinstance(i, xpidl.IDL))
00018         self.assertEqual([], i.productions)

Here is the call graph for this function:

Definition at line 19 of file runtests.py.

00019 
00020     def testForwardInterface(self):
00021         i = self.p.parse("interface foo;", filename='f')
00022         self.assertTrue(isinstance(i, xpidl.IDL))
00023         self.assertTrue(isinstance(i.productions[0], xpidl.Forward))
00024         self.assertEqual("foo", i.productions[0].name)

Here is the call graph for this function:

Definition at line 25 of file runtests.py.

00025 
00026     def testInterface(self):
00027         i = self.p.parse("[uuid(abc)] interface foo {};", filename='f')
00028         self.assertTrue(isinstance(i, xpidl.IDL))
00029         self.assertTrue(isinstance(i.productions[0], xpidl.Interface))
00030         self.assertEqual("foo", i.productions[0].name)

Here is the call graph for this function:

Definition at line 49 of file runtests.py.

00049 
00050     def testMethod(self):
00051         i = self.p.parse("""[uuid(abc)] interface foo {
00052 void bar();
00053 };""", filename='f')
00054         self.assertTrue(isinstance(i, xpidl.IDL))
00055         self.assertTrue(isinstance(i.productions[0], xpidl.Interface))
00056         iface = i.productions[0]
00057         m = iface.members[0]
00058         self.assertTrue(isinstance(m, xpidl.Method))
00059         self.assertEqual("bar", m.name)
00060         self.assertEqual("void", m.type)

Here is the call graph for this function:

Definition at line 61 of file runtests.py.

00061 
00062     def testMethodParams(self):
00063         i = self.p.parse("""[uuid(abc)] interface foo {
00064 long bar(in long a, in float b, [array] in long c);
00065 };""", filename='f')
00066         i.resolve([], self.p)
00067         self.assertTrue(isinstance(i, xpidl.IDL))
00068         self.assertTrue(isinstance(i.productions[0], xpidl.Interface))
00069         iface = i.productions[0]
00070         m = iface.members[0]
00071         self.assertTrue(isinstance(m, xpidl.Method))
00072         self.assertEqual("bar", m.name)
00073         self.assertEqual("long", m.type)
00074         self.assertEqual(3, len(m.params))
00075         self.assertEqual("long", m.params[0].type)
00076         self.assertEqual("in", m.params[0].paramtype)
00077         self.assertEqual("float", m.params[1].type)
00078         self.assertEqual("in", m.params[1].paramtype)
00079         self.assertEqual("long", m.params[2].type)
00080         self.assertEqual("in", m.params[2].paramtype)
00081         self.assertTrue(isinstance(m.params[2].realtype, xpidl.Array))
00082         self.assertEqual("long", m.params[2].realtype.type.name)

Here is the call graph for this function:


Member Data Documentation

Definition at line 12 of file runtests.py.


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