Example #1
0
 def test_exit(self):
     args = DummyArgs()
     args.cmd = "python"
     args.args = os.path.join(os.path.dirname(__file__), "endless.py")
     args.verbose = True
     out = StringIO.StringIO()
     sys.stderr = out
     execute(args)
     sys.stderr = sys.__stderr__
     f = CPUPAT.findall(out.getvalue())
     self.failUnlessEqual(len(f), args.cycles)
     for i in range(args.cycles):
         self.failIf(float(f[i][0]) <= args.limit)
Example #2
0
 def test_simplecall(self):
     args = DummyArgs()
     self.assertEqual(execute(args), "foo bar\n")