Ejemplo n.º 1
0
 def test_run(self):
     p = AsyncRemoteProcess('localhost', ['/bin/echo', '-n', 'foo'], [])
     p.start()
     for i in range(20): # expecting this command to complete in two second
         time.sleep(0.1)
     p.stop()
     self.assertFalse(p.is_running())
     self.assertEqual('foo', p.stdout)
Ejemplo n.º 2
0
 def test_run(self):
     p = AsyncRemoteProcess('localhost', ['/bin/echo', '-n', 'foo'], [])
     p.start()
     for i in range(20): # expecting this command to complete in two second
         time.sleep(0.1)
     p.stop()
     self.assertFalse(p.is_running())
     self.assertEqual(b'foo', p.stdout)
Ejemplo n.º 3
0
 def test_timeout(self):
     p = AsyncRemoteProcess('localhost', ['sleep', '120'], [], 1)
     p.start()
     time.sleep(5)
     self.assertFalse(p.is_running())
Ejemplo n.º 4
0
 def test_timeout(self):
     p = AsyncRemoteProcess('localhost', ['sleep', '120'], [], 1)
     p.start()
     time.sleep(5)
     self.assertFalse(p.is_running())