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)
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
def testProcess(self): self.assert_(service.IProcess.providedBy(service.Process()))
def testProcessName(self): p = service.Process() self.assertEqual(p.processName, None) p.processName = 'hello' self.assertEqual(p.processName, 'hello')
def testID(self): p = service.Process(5, 6) self.assertEqual(p.uid, 5) self.assertEqual(p.gid, 6)
def testProcessName(self): p = service.Process() self.assertIsNone(p.processName) p.processName = "hello" self.assertEqual(p.processName, "hello")