Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(7)  |  Derive(0)  |  Import(3)

src/k/a/kamaelia-HEAD/Tests/Python/Axon/test_Microprocess.py   kamaelia(Download)
from test___str__ import str_Test
from Axon.Microprocess import microprocess as microprocess
from Axon.util import next,vrange
 
class MicroProcess_Test(str_Test):
      thr = self.init_test(testthread)
      thr.activate(self.DummySched())
      for i in vrange(1,101):
         self.failUnless(thr.next(), "Unexpected false return value")
         self.failUnless(thr.i == i, "Iteration of main not performed!")
      sched = self.DummySched()
      thr.activate(sched)
      for x in vrange(1,5):
         self.failUnless(thr.next())
         self.failUnless(thr.i == x)
      thr.pause()
      for x in vrange(5,10):
         self.assert_(thr.i == x, "Thread does not pause itself, that is down to the scheduler")
      thr.unpause()
      for x in vrange(10,15):
         self.failUnless(thr.next())
         self.failUnless(thr.i == x)

src/k/a/kamaelia-HEAD/Tests/Python/Axon/test_Component.py   kamaelia(Download)
import re
from Axon.Component import *
from Axon.util import next,vrange
import Axon.Linkage as Linkage
 
      self.failUnless(signalbox.pop(0)=="boom", "Items arrived out of order")
 
      for x in vrange(0,1000):
          tcomp.tc1.send(x)
          self.failUnless(tcomp.tc1.outboxes["outbox"].pop(0)==x, "Failed while sending lots without clearing box.")
      m=t.main()
      self.failUnless(next(m)==1)
      for x in vrange(1,1000):
          self.failUnless(next(m)==x, "Failed when x = " + str(x))
      self.failUnless(next(m)==1,"After the main method returns a false value the result of closeDownComponent is returned.  Stub of 1 assumed.")
      m=t.main()
      self.failUnless(next(m)==1)
      for x in vrange(1,1000):
          self.failUnless(next(m)==x, "Failed when x = " + str(x))
      self.failUnlessRaises(closeDownCompTestException , lambda: next(m))#Ensures that the closeDownComponent method has been called.

src/k/a/kamaelia-HEAD/Tests/Python/Axon/test_Postoffice.py   kamaelia(Download)
from Axon.AxonExceptions import noSpaceInBox
from Axon.AxonExceptions import BoxAlreadyLinkedToDestination
from Axon.util import next,vrange
 
class Dummybox(list):