示例#1
0
 def testDefaults(self):
     p = service.Process(5)
     self.assertEqual(p.uid, 5)
     self.assertEqual(p.gid, None)
     p = service.Process(gid=5)
     self.assertEqual(p.uid, None)
     self.assertEqual(p.gid, 5)
     p = service.Process()
     self.assertEqual(p.uid, None)
     self.assertEqual(p.gid, None)
示例#2
0
def Application(name, uid=None, gid=None):
    """Return a compound class.

    Return an object supporting the C{IService}, C{IServiceCollection},
    C{IProcess} and C{sob.IPersistable} interfaces, with the given
    parameters. Always access the return value by explicit casting to
    one of the interfaces.
    """
    ret = components.Componentized()
    for comp in (Bots(), sob.Persistent(ret, name), service.Process(uid, gid)):
        ret.addComponent(comp, ignoreClass=1)
    service.IService(ret).setName(name)
    return ret
示例#3
0
 def testProcess(self):
     self.assert_(service.IProcess.providedBy(service.Process()))
示例#4
0
 def testProcessName(self):
     p = service.Process()
     self.assertEqual(p.processName, None)
     p.processName = 'hello'
     self.assertEqual(p.processName, 'hello')
示例#5
0
 def testID(self):
     p = service.Process(5, 6)
     self.assertEqual(p.uid, 5)
     self.assertEqual(p.gid, 6)
示例#6
0
 def testProcessName(self):
     p = service.Process()
     self.assertIsNone(p.processName)
     p.processName = "hello"
     self.assertEqual(p.processName, "hello")