예제 #1
0
 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')
예제 #2
0
 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')
예제 #3
0
 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")