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
1=== modified file 'bin/duplicity'
2--- bin/duplicity 2012-02-05 18:13:40 +0000
3+++ bin/duplicity 2012-02-07 22:25:29 +0000
4@@ -1221,9 +1221,6 @@
5 # determine what action we're performing and process command line
6 action = commandline.ProcessCommandLine(sys.argv[1:])
7
8- # update the regex with provided file-prefix
9- file_naming.prepare_regex()
10-
11 # The following is for starting remote debugging in Eclipse with Pydev.
12 # Adjust the path to your location and version of Eclipse and Pydev.
13 if globals.pydevd:
14
15=== modified file 'duplicity/file_naming.py'
16--- duplicity/file_naming.py 2012-01-19 17:10:57 +0000
17+++ duplicity/file_naming.py 2012-02-07 22:25:29 +0000
18@@ -52,6 +52,9 @@
19 global new_sig_re
20 global new_sig_re_short
21
22+ if full_vol_re:
23+ return
24+
25 full_vol_re = re.compile("^" + globals.file_prefix + "duplicity-full"
26 "\\.(?P<time>.*?)"
27 "\\.vol(?P<num>[0-9]+)"
28@@ -172,7 +175,8 @@
29 Return appropriate suffix depending on status of
30 encryption, compression, and short_filenames.
31 """
32- assert not (encrypted and gzipped)
33+ if encrypted:
34+ gzipped = False
35 if encrypted:
36 if globals.short_filenames:
37 suffix = '.g'
38@@ -198,7 +202,8 @@
39 filename is of a full or inc manifest file.
40 """
41 assert dup_time.curtimestr
42- assert not (encrypted and gzipped)
43+ if encrypted:
44+ gzipped = False
45 suffix = get_suffix(encrypted, gzipped)
46 part_string = ""
47 if globals.short_filenames:
48@@ -291,6 +296,7 @@
49 """
50 Return ParseResults if file is from full backup, None otherwise
51 """
52+ prepare_regex()
53 short = True
54 m1 = full_vol_re_short.search(filename)
55 m2 = full_manifest_re_short.search(filename)
56@@ -313,6 +319,7 @@
57 """
58 Return ParseResults if file is from inc backup, None otherwise
59 """
60+ prepare_regex()
61 short = True
62 m1 = inc_vol_re_short.search(filename)
63 m2 = inc_manifest_re_short.search(filename)
64@@ -336,6 +343,7 @@
65 """
66 Return ParseResults if file is a signature, None otherwise
67 """
68+ prepare_regex()
69 short = True
70 m = full_sig_re_short.search(filename)
71 if not m and not globals.short_filenames:

Subscribers

People subscribed via source and target branches

to all changes: