def test_scripttask(self): if os.path.exists('hello.txt'): os.remove('hello.txt') s = ScriptTask({'script':"echo 'hello world'",'stdout_file':'hello.txt'}) s.run_task({}) self.assertTrue(os.path.exists('hello.txt')) with open('hello.txt') as fp: line = fp.readlines()[0] self.assertTrue('hello world' in line) os.remove('hello.txt')
def test_scripttask(self): if os.path.exists('hello.txt'): os.remove('hello.txt') s = ScriptTask({ 'script': 'echo "hello world"', 'stdout_file': 'hello.txt' }) s.run_task({}) self.assertTrue(os.path.exists('hello.txt')) with open('hello.txt') as fp: line = fp.readlines()[0] self.assertTrue('hello world' in line) os.remove('hello.txt')
def test_scripttask(self): if os.path.exists("hello.txt"): os.remove("hello.txt") s = ScriptTask({ "script": 'echo "hello world"', "stdout_file": "hello.txt" }) s.run_task({}) self.assertTrue(os.path.exists("hello.txt")) with open("hello.txt") as fp: line = fp.readlines()[0] self.assertTrue("hello world" in line) os.remove("hello.txt")