Merge lp:~verterok/ubuntuone-client/u1sdtool_fix_list-folders_subscribed-stable-1-2 into lp:ubuntuone-client/stable-1-2

Proposed by Guillermo Gonzalez
Status: Merged
Approved by: Guillermo Gonzalez
Approved revision: 520
Merged at revision: 520
Proposed branch: lp:~verterok/ubuntuone-client/u1sdtool_fix_list-folders_subscribed-stable-1-2
Merge into: lp:ubuntuone-client/stable-1-2
Diff against target: 57 lines (+24/-10)
2 files modified
tests/syncdaemon/test_u1sdtool.py (+22/-9)
ubuntuone/syncdaemon/tools.py (+2/-1)
To merge this branch: bzr merge lp:~verterok/ubuntuone-client/u1sdtool_fix_list-folders_subscribed-stable-1-2
Reviewer Review Type Date Requested Status
John O'Brien (community) Approve
Roman Yepishev (community) Approve
Review via email: mp+31584@code.launchpad.net

Commit message

Fix u1sdtool --list-folders to correctly show unsubscribed status.

Description of the change

This branch fix u1sdtool --list-folders to correctly show unsubscribed status.

To post a comment you must log in.
Revision history for this message
Roman Yepishev (rye) wrote :

Works as well.

review: Approve
Revision history for this message
John O'Brien (jdobrien) wrote :

looks good and tests pass...

review: Approve
Revision history for this message
dobey (dobey) wrote :
Download full text (254.9 KiB)

The attempt to merge lp:~verterok/ubuntuone-client/u1sdtool_fix_list-folders_subscribed-stable-1-2 into lp:ubuntuone-client/stable-1-2 failed.Below is the output from the failed tests.

/usr/bin/gnome-autogen.sh
checking for autoconf >= 2.53...
  testing autoconf2.50... not found.
  testing autoconf... found 2.65
checking for automake >= 1.10...
  testing automake-1.11... found 1.11.1
checking for libtool >= 1.5...
  testing libtoolize... found 2.2.6b
checking for intltool >= 0.30...
  testing intltoolize... found 0.41.1
checking for pkg-config >= 0.14.0...
  testing pkg-config... found 0.25
Checking for required M4 macros...
Checking for forbidden M4 macros...
Processing ./configure.ac
Running libtoolize...
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
Running intltoolize...
Running aclocal-1.11...
Running autoconf...
Running autoheader...
Running automake-1.11...
Running ./configure --with-protocol=/var/cache/tarmac/ubuntuone-storage-protocol/stable-1-2 ...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for library containing strerror... none required
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent librari...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/syncdaemon/test_u1sdtool.py'
2--- tests/syncdaemon/test_u1sdtool.py 2010-05-17 22:23:56 +0000
3+++ tests/syncdaemon/test_u1sdtool.py 2010-08-03 19:47:50 +0000
4@@ -298,8 +298,8 @@
5 return d
6
7 @defer.inlineCallbacks
8- def test_show_folders(self):
9- """test the output of --list-folders """
10+ def test_show_folders_subscribed(self):
11+ """Test the output of --list-folders."""
12 out = StringIO()
13 path = u'ñoño'.encode('utf-8')
14 suggested_path = os.path.join("~", u'ñoño')
15@@ -309,10 +309,23 @@
16 yield self.main.vm.add_udf(udf)
17 expected = u"Folder list:\n id=folder_id subscribed=True " + \
18 u"path=\xf1o\xf1o\n"
19- d = self.tool.get_folders()
20- d.addCallback(lambda result: show_folders(result, out))
21- def check(result):
22- """check the output"""
23- self.assertEquals(out.getvalue(), expected)
24- d.addCallback(check)
25- yield d
26+ result = yield self.tool.get_folders()
27+ show_folders(result, out)
28+ self.assertEquals(out.getvalue(), expected)
29+
30+ @defer.inlineCallbacks
31+ def test_show_folders_unsubscribed(self):
32+ """Test the output of --list-folders with a unsubscribed folder."""
33+ out = StringIO()
34+ path = u'ñoño'.encode('utf-8')
35+ suggested_path = os.path.join("~", u'ñoño')
36+
37+ udf = UDF("folder_id", "node_id", suggested_path, path,
38+ subscribed=True)
39+ yield self.main.vm.add_udf(udf)
40+ self.main.vm.unsubscribe_udf(udf.id)
41+ expected = u"Folder list:\n id=folder_id subscribed=False " + \
42+ u"path=\xf1o\xf1o\n"
43+ result = yield self.tool.get_folders()
44+ show_folders(result, out)
45+ self.assertEquals(out.getvalue(), expected)
46
47=== modified file 'ubuntuone/syncdaemon/tools.py'
48--- ubuntuone/syncdaemon/tools.py 2010-05-27 20:37:10 +0000
49+++ ubuntuone/syncdaemon/tools.py 2010-08-03 19:47:50 +0000
50@@ -754,7 +754,8 @@
51 out.write("Folder list:\n")
52 for folder in folders:
53 msg_template = ' id=%s subscribed=%s path=%s\n'
54- out.write(msg_template % (folder['volume_id'], folder['subscribed'],
55+ out.write(msg_template % (folder['volume_id'],
56+ bool(folder['subscribed']),
57 folder['path']))
58
59

Subscribers

People subscribed via source and target branches