19
19
# along with duplicity; if not, write to the Free Software Foundation,
20
20
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
testing = os.path.dirname(sys.argv[0])
24
newpath = os.path.abspath(os.path.join(testing, "../../."))
25
sys.path.insert(0, newpath)
28
gettext.install('duplicity', codeset='utf8')
30
from duplicity import globals
31
from duplicity import log
32
from duplicity import backend
33
from duplicity.backends import localbackend
35
# config for duplicity unit tests
37
# verbosity, default is log.WARNING
38
verbosity = log.WARNING
40
# to test GPG and friends
41
# these must be without passwords
45
# password required on this one
50
# NOTE: if the ***_url is None or "" the test
51
# is skipped and is noted in the test results.
53
file_url = "file:///tmp/testdup"
56
# To set up rsyncd for test:
57
# /etc/rsyncd.conf contains
60
# comment = Test area for duplicity
63
# NOTE: chmod 777 /tmp/testdup
23
# NOTE: if the ***_url is None, the test is skipped
66
26
ftp_password = None
91
68
gdocs_password = None
94
""" setup for unit tests """
95
# The following is for starting remote debugging in Eclipse with Pydev.
96
# Adjust the path to your location and version of Eclipse and Pydev. Comment out
97
# to run normally, or this process will hang at pydevd.settrace() waiting for the
98
# remote debugger to start.
99
# pysrc = "/opt/Aptana Studio 2/plugins/org.python.pydev.debug_2.1.0.2011052613/pysrc/"
100
# sys.path.append(pysrc)
101
# import pydevd #@UnresolvedImport
103
# end remote debugger startup
106
log.setverbosity(verbosity)
107
globals.print_statistics = 0
109
globals.num_retries = 2
111
backend.import_backends()
113
set_environ("FTP_PASSWORD", None)
114
set_environ("PASSPHRASE", None)
116
set_environ("GS_ACCESS_KEY_ID", gs_access_key)
117
set_environ("GS_SECRET_ACCESS_KEY", gs_secret_key)
119
set_environ("GS_ACCESS_KEY_ID", None)
120
set_environ("GS_SECRET_ACCESS_KEY", None)
122
set_environ("AWS_ACCESS_KEY_ID", s3_access_key)
123
set_environ("AWS_SECRET_ACCESS_KEY", s3_secret_key)
125
set_environ("AWS_ACCESS_KEY_ID", None)
126
set_environ("AWS_SECRET_ACCESS_KEY", None)
129
def set_environ(varname, value):
130
if value is not None:
131
os.environ[varname] = value
134
del os.environ[varname]