Esempio n. 1
0
    def testRunWithArgs(self):
	prog = self.touchprog
	# Make sure the file doesn't exist
	self.failIf(os.path.exists(self.tempfilename))
	# Create a temporary file
	args = [self.tempfilename]
	wrap.run(prog,args)
	self.failUnless(os.path.exists(self.tempfilename))
Esempio n. 2
0
    def testRunFailure(self):
        """Make sure that the fail program exists. Build it if necessary"""
        if not (os.access("fail", os.X_OK) or os.access("fail.exe", os.X_OK)):
            res = os.system("gcc -o fail test/testsource/fail.c")
            if res != 0:
                raise ValueError, "Could not build fail program"

        success = wrap.run("./fail", ["fail"])
        self.assertEquals(success, False)
Esempio n. 3
0
    def testRunSuccess(self):
        """Make sure that the success program exists. Build it if necessary"""
        if not (os.access("success", os.X_OK) or os.access("success.exe", os.X_OK)):
            res = os.system("gcc -o success success.c")
            if res != 0:
                raise ValueError, "Could not build success program"

        success = wrap.run("./success", ["success"])
        self.assertEquals(success, True)
Esempio n. 4
0
 def testRunFailure(self):
     # Runa  program that fails and test for failure
     s = wrap.run(self.failprog,[self.failprog])
     self.failIf(s)
Esempio n. 5
0
 def testRunSuccess(self):
     # Run a program that succeeds
     s = wrap.run(self.successprog,[self.successprog])
     self.failUnless(s)
Esempio n. 6
0
    def testRunNoArgs(self):
	# Run a program with no arguments
        os.chmod('test/testsource/createfile.sh',0755)
	s = wrap.run('test/testsource/createfile.sh',[])
	self.failUnless(os.path.exists(self.tempfilename))