fakessh: cleanup master test.

This commit is contained in:
David Wilson 2017-09-21 13:06:59 +05:30
parent 76d1e66790
commit 5dff221842
1 changed files with 7 additions and 3 deletions

View File

@ -3,7 +3,6 @@ import os
import shutil
import unittest
import mitogen.utils
import mitogen.fakessh
import testlib
@ -12,11 +11,16 @@ import testlib
class RsyncTest(testlib.DockerMixin, unittest.TestCase):
def test_rsync_from_master(self):
context = self.docker_ssh_any()
context.call(shutil.rmtree, '/tmp/data', ignore_errors=True)
mitogen.fakessh.run(context, self.router, [
if context.call(os.path.exists, '/tmp/data'):
context.call(shutil.rmtree, '/tmp/data')
return_code = mitogen.fakessh.run(context, self.router, [
'rsync', '--progress', '-vvva',
testlib.data_path('.'), 'target:/tmp/data'
])
assert return_code == 0
assert context.call(os.path.exists, '/tmp/data')
assert context.call(os.path.exists, '/tmp/data/simple_pkg/a.py')