def sync(self, source=None): """rsyncs the given path to the remote pacha instance""" if not source: source = self.path dest = '%s@%s:%s' % (self.conf['ssh_user'], self.conf['host'], self.dest_path) command = "rsync -av %s %s" % (source, dest) snc_log.debug('destination command for clone: %s' % command) run_command(std="stdout", cmd=command)
def test_run_command_stderr(self): sys.stderr = MockSys() actual = run_command(std="stderr", cmd=""" echo "error message" 1>&2 """) expected = ['error message\n'] self.assertEqual(actual, expected)
def test_run_command_stdout(self): sys.stderr = MockSys() actual = run_command(std="stdout", cmd="""echo "foo" """) expected = ['foo\n'] self.assertEqual(actual, expected)
def revision(self): """Gets the revision ID from the path""" changeset = run_command(std="stdout", cmd="hg head")[0] return changeset[-13:].split('\n')