Merge lp:~mterry/duplicity/testfixes into lp:duplicity/0.6

Proposed by Michael Terry
Status: Merged
Merged at revision: 829
Proposed branch: lp:~mterry/duplicity/testfixes
Merge into: lp:duplicity/0.6
Diff against target: 71 lines (+10/-5)
2 files modified
bin/duplicity (+0/-3)
duplicity/file_naming.py (+10/-2)
To merge this branch: bzr merge lp:~mterry/duplicity/testfixes
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+91935@code.launchpad.net

Description of the change

Here are two changes that help the test suite pass (it got broken after the recent round of merges).

1) When file_naming is asked for a name, don't assert if compression AND encryption are turned on. They are by default now. But globals.compression is only meant to take effect if encryption is turned off. So when encryption is on, just turn off gzip suffixes.

2) Some tests are unit tests that directly import the relevant duplicity code. So make sure that regular expressions are setup lazily as needed, not once at the start of bin/duplicity.

There are still test failures after these two. I'm still looking... But these two seem safe.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/duplicity'
--- bin/duplicity 2012-02-05 18:13:40 +0000
+++ bin/duplicity 2012-02-07 22:25:29 +0000
@@ -1221,9 +1221,6 @@
1221 # determine what action we're performing and process command line1221 # determine what action we're performing and process command line
1222 action = commandline.ProcessCommandLine(sys.argv[1:])1222 action = commandline.ProcessCommandLine(sys.argv[1:])
12231223
1224 # update the regex with provided file-prefix
1225 file_naming.prepare_regex()
1226
1227 # The following is for starting remote debugging in Eclipse with Pydev.1224 # The following is for starting remote debugging in Eclipse with Pydev.
1228 # Adjust the path to your location and version of Eclipse and Pydev.1225 # Adjust the path to your location and version of Eclipse and Pydev.
1229 if globals.pydevd:1226 if globals.pydevd:
12301227
=== modified file 'duplicity/file_naming.py'
--- duplicity/file_naming.py 2012-01-19 17:10:57 +0000
+++ duplicity/file_naming.py 2012-02-07 22:25:29 +0000
@@ -52,6 +52,9 @@
52 global new_sig_re52 global new_sig_re
53 global new_sig_re_short53 global new_sig_re_short
5454
55 if full_vol_re:
56 return
57
55 full_vol_re = re.compile("^" + globals.file_prefix + "duplicity-full"58 full_vol_re = re.compile("^" + globals.file_prefix + "duplicity-full"
56 "\\.(?P<time>.*?)"59 "\\.(?P<time>.*?)"
57 "\\.vol(?P<num>[0-9]+)"60 "\\.vol(?P<num>[0-9]+)"
@@ -172,7 +175,8 @@
172 Return appropriate suffix depending on status of175 Return appropriate suffix depending on status of
173 encryption, compression, and short_filenames.176 encryption, compression, and short_filenames.
174 """177 """
175 assert not (encrypted and gzipped)178 if encrypted:
179 gzipped = False
176 if encrypted:180 if encrypted:
177 if globals.short_filenames:181 if globals.short_filenames:
178 suffix = '.g'182 suffix = '.g'
@@ -198,7 +202,8 @@
198 filename is of a full or inc manifest file.202 filename is of a full or inc manifest file.
199 """203 """
200 assert dup_time.curtimestr204 assert dup_time.curtimestr
201 assert not (encrypted and gzipped)205 if encrypted:
206 gzipped = False
202 suffix = get_suffix(encrypted, gzipped)207 suffix = get_suffix(encrypted, gzipped)
203 part_string = ""208 part_string = ""
204 if globals.short_filenames:209 if globals.short_filenames:
@@ -291,6 +296,7 @@
291 """296 """
292 Return ParseResults if file is from full backup, None otherwise297 Return ParseResults if file is from full backup, None otherwise
293 """298 """
299 prepare_regex()
294 short = True300 short = True
295 m1 = full_vol_re_short.search(filename)301 m1 = full_vol_re_short.search(filename)
296 m2 = full_manifest_re_short.search(filename)302 m2 = full_manifest_re_short.search(filename)
@@ -313,6 +319,7 @@
313 """319 """
314 Return ParseResults if file is from inc backup, None otherwise320 Return ParseResults if file is from inc backup, None otherwise
315 """321 """
322 prepare_regex()
316 short = True323 short = True
317 m1 = inc_vol_re_short.search(filename)324 m1 = inc_vol_re_short.search(filename)
318 m2 = inc_manifest_re_short.search(filename)325 m2 = inc_manifest_re_short.search(filename)
@@ -336,6 +343,7 @@
336 """343 """
337 Return ParseResults if file is a signature, None otherwise344 Return ParseResults if file is a signature, None otherwise
338 """345 """
346 prepare_regex()
339 short = True347 short = True
340 m = full_sig_re_short.search(filename)348 m = full_sig_re_short.search(filename)
341 if not m and not globals.short_filenames:349 if not m and not globals.short_filenames:

Subscribers

People subscribed via source and target branches

to all changes: