Merge lp:~aaron-whitehouse/duplicity/fix_patch_error into lp:~duplicity-team/duplicity/0.7-series

Proposed by Aaron Whitehouse
Status: Merged
Merged at revision: 1118
Proposed branch: lp:~aaron-whitehouse/duplicity/fix_patch_error
Merge into: lp:~duplicity-team/duplicity/0.7-series
Diff against target: 55 lines (+16/-5)
2 files modified
po/duplicity.pot (+1/-1)
testing/unit/test_selection.py (+15/-4)
To merge this branch: bzr merge lp:~aaron-whitehouse/duplicity/fix_patch_error
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+266676@code.launchpad.net

Description of the change

Change use of mock.patch in unit tests to accommodate the obsolete version of python-mock on the build server.

To post a comment you must log in.
Revision history for this message
Aaron Whitehouse (aaron-whitehouse) wrote :

Also very minor PEP8 line length fixes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'po/duplicity.pot'
--- po/duplicity.pot 2015-08-02 11:44:34 +0000
+++ po/duplicity.pot 2015-08-03 00:02:14 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: Kenneth Loafman <kenneth@loafman.com>\n"10"Report-Msgid-Bugs-To: Kenneth Loafman <kenneth@loafman.com>\n"
11"POT-Creation-Date: 2015-08-02 06:35-0500\n"11"POT-Creation-Date: 2015-08-03 00:36+0100\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
1515
=== modified file 'testing/unit/test_selection.py'
--- testing/unit/test_selection.py 2015-07-31 08:22:31 +0000
+++ testing/unit/test_selection.py 2015-08-03 00:02:14 +0000
@@ -56,11 +56,17 @@
5656
57 def test_tuple_include(self):57 def test_tuple_include(self):
58 """Test include selection function made from a regular filename"""58 """Test include selection function made from a regular filename"""
59 self.assertRaises(FilePrefixError, self.Select.glob_get_normal_sf, "foo", 1)59 self.assertRaises(FilePrefixError, self.Select.glob_get_normal_sf,
60 "foo", 1)
6061
61 sf2 = self.Select.glob_get_sf("testfiles/select/usr/local/bin/", 1)62 sf2 = self.Select.glob_get_sf("testfiles/select/usr/local/bin/", 1)
6263
63 with patch('duplicity.path.ROPath.isdir', return_value=True):64 with patch('duplicity.path.ROPath.isdir') as mock_isdir:
65 mock_isdir.return_value = True
66 # Can't pass the return_value as an argument to patch, i.e.:
67 # with patch('duplicity.path.ROPath.isdir', return_value=True):
68 # as build system's mock is too old to support it.
69
64 assert sf2(self.makeext("usr")) == 170 assert sf2(self.makeext("usr")) == 1
65 assert sf2(self.makeext("usr/local")) == 171 assert sf2(self.makeext("usr/local")) == 1
66 assert sf2(self.makeext("usr/local/bin")) == 172 assert sf2(self.makeext("usr/local/bin")) == 1
@@ -70,11 +76,16 @@
7076
71 def test_tuple_exclude(self):77 def test_tuple_exclude(self):
72 """Test exclude selection function made from a regular filename"""78 """Test exclude selection function made from a regular filename"""
73 self.assertRaises(FilePrefixError, self.Select.glob_get_normal_sf, "foo", 0)79 self.assertRaises(FilePrefixError, self.Select.glob_get_normal_sf,
80 "foo", 0)
7481
75 sf2 = self.Select.glob_get_sf("testfiles/select/usr/local/bin/", 0)82 sf2 = self.Select.glob_get_sf("testfiles/select/usr/local/bin/", 0)
7683
77 with patch('duplicity.path.ROPath.isdir', return_value=True):84 with patch('duplicity.path.ROPath.isdir') as mock_isdir:
85 mock_isdir.return_value = True
86 # Can't pass the return_value as an argument to patch, as build
87 # system's mock is too old to support it.
88
78 assert sf2(self.makeext("usr")) is None89 assert sf2(self.makeext("usr")) is None
79 assert sf2(self.makeext("usr/local")) is None90 assert sf2(self.makeext("usr/local")) is None
80 assert sf2(self.makeext("usr/local/bin")) == 091 assert sf2(self.makeext("usr/local/bin")) == 0

Subscribers

People subscribed via source and target branches