def create_settings_local(): with cd(CIDADEILUMINADA_WORK_PATH), virtualenv(CIDADEILUMINADA_WORK_PATH): instance_path = sudo('python manage.py instance_path') require.files.directories([instance_path], use_sudo=True) settings_path = os.path.join(CIDADEILUMINADA_WORK_PATH, 'settings.py') settings_local_path = os.path.join(instance_path, 'settings_local.py') files.copy(settings_path, settings_local_path, use_sudo=True)
def test_copy_recursive(mock_run): from fabtools.files import copy copy('/tmp/src', '/tmp/dst', recursive=True) mock_run.assert_called_with('/bin/cp -r /tmp/src /tmp/dst')
def test_copy(mock_run): from fabtools.files import copy copy('/tmp/src', '/tmp/dst') mock_run.assert_called_with('/bin/cp /tmp/src /tmp/dst')
def test_copy_force(mock_run): from fabtools.files import copy copy('/tmp/src', '/tmp/dst', force=True) mock_run.assert_called_with('/bin/cp -f /tmp/src /tmp/dst')