~ubuntu-branches/ubuntu/precise/ubuntuone-client/precise-201112142106

« back to all changes in this revision

Viewing changes to tests/platform/linux/test_u1sdtool.py

  • Committer: Bazaar Package Importer
  • Author(s): Rodney Dawes
  • Date: 2011-08-09 12:47:56 UTC
  • mfrom: (1.1.53 upstream)
  • Revision ID: james.westby@ubuntu.com-20110809124756-7nzilp3oix0a1yl9
Tags: 1.7.1-0ubuntu1
* New upstream release.
* debian/*:
  - Removed obsolete pycompat file
  - Removed ubuntuone-client-gnome deps and binary packaging, as it was
    moved out to separate project upstream.
  - Updated copyright to remove obsolete file reference
* debian/patches:
  - Removed patches which have been included upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
from ubuntuone.syncdaemon.volume_manager import Share, UDF
29
29
from ubuntuone.platform.linux.tools import (
30
30
    show_dirty_nodes,
 
31
    show_downloads,
 
32
    show_folders,
 
33
    show_free_space,
31
34
    show_path_info,
32
 
    show_uploads,
33
 
    show_downloads,
 
35
    show_shared,
34
36
    show_shares,
35
 
    show_shared,
36
 
    show_folders,
37
37
    show_state,
 
38
    show_uploads,
38
39
    show_waiting,
39
40
    show_waiting_content,
40
41
    show_waiting_metadata,
235
236
        return d
236
237
 
237
238
    @defer.inlineCallbacks
 
239
    def test_show_free_space(self):
 
240
        """Test the output of --free-space"""
 
241
        share_path = os.path.join(self.main.shares_dir, 'share')
 
242
        share = Share(path=share_path, volume_id='vol_id')
 
243
        yield self.main.vm.add_share(share)
 
244
        self.main.vm.update_free_space('vol_id', 12345)
 
245
 
 
246
        out = StringIO()
 
247
        expected = "Free space: 12345 bytes\n"
 
248
 
 
249
        result = yield self.tool.free_space('vol_id')
 
250
        show_free_space(result, out)
 
251
        self.assertEquals(out.getvalue(), expected)
 
252
 
 
253
    @defer.inlineCallbacks
238
254
    def test_show_waiting_simple(self):
239
255
        """Test the output of --waiting-metadata"""
240
256
        # inject the fake data