コード例 #1
0
ファイル: remote.py プロジェクト: kumagi/jubatest
 def test_put_file(self):
     with tempfile.NamedTemporaryFile(
     ) as tmp1, tempfile.NamedTemporaryFile() as tmp2:
         tmp1.write('foo')
         tmp1.flush()
         SyncRemoteProcess.put_file('localhost', tmp1.name, tmp2.name)
         self.assertEqual('foo', tmp2.read())
コード例 #2
0
ファイル: remote.py プロジェクト: kumagi/jubatest
 def test_put_file(self):
     with tempfile.NamedTemporaryFile() as tmp1, tempfile.NamedTemporaryFile() as tmp2:
         tmp1.write('foo')
         tmp1.flush()
         SyncRemoteProcess.put_file('localhost', tmp1.name, tmp2.name)
         self.assertEqual('foo', tmp2.read())
コード例 #3
0
ファイル: remote.py プロジェクト: kumagi/jubatest
 def test_get_file(self):
     with tempfile.NamedTemporaryFile() as tmp:
         SyncRemoteProcess.get_file('localhost', '/etc/hosts', tmp.name)
         with open('/etc/hosts', 'r') as expected_file:
             self.assertEqual(expected_file.read(), tmp.read())
コード例 #4
0
ファイル: remote.py プロジェクト: kumagi/jubatest
 def test_run(self):
     result = SyncRemoteProcess.run('localhost', ['/bin/echo', '-n', 'foo'])
     self.assertEqual('foo', result)
コード例 #5
0
ファイル: remote.py プロジェクト: rimms/jubatest
 def test_run_timeout(self):
     result = SyncRemoteProcess.run('localhost', ['/bin/echo', '-n', 'baz'], {}, 5)
     self.assertEquals('baz', result)
コード例 #6
0
ファイル: remote.py プロジェクト: rimms/jubatest
 def test_run_envvar(self):
     result = SyncRemoteProcess.run('localhost', ['/bin/echo', '-n', '${PARAM}'], {'PARAM': 'bar'})
     self.assertEquals('bar', result)
コード例 #7
0
ファイル: remote.py プロジェクト: kmaehashi/jubatest
 def test_get_file(self):
     with tempfile.NamedTemporaryFile() as tmp:
         SyncRemoteProcess.get_file('localhost', '/etc/hosts', tmp.name)
         with open('/etc/hosts', 'rb') as expected_file:
             self.assertEqual(expected_file.read(), tmp.read())
コード例 #8
0
ファイル: remote.py プロジェクト: kmaehashi/jubatest
 def test_run_timeout(self):
     result = SyncRemoteProcess.run('localhost', ['/bin/echo', '-n', 'baz'], {}, 5)
     self.assertEquals(b'baz', result)
コード例 #9
0
ファイル: remote.py プロジェクト: kmaehashi/jubatest
 def test_run_envvar(self):
     result = SyncRemoteProcess.run('localhost', ['/bin/echo', '-n', '${PARAM}'], {'PARAM': 'bar'})
     self.assertEquals(b'bar', result)
コード例 #10
0
ファイル: remote.py プロジェクト: kmaehashi/jubatest
 def test_run(self):
     result = SyncRemoteProcess.run('localhost', ['/bin/echo', '-n', 'foo'])
     self.assertEqual(b'foo', result)