~chipaca/ubuntuone-client/public_files_list_v2

« back to all changes in this revision

Viewing changes to tests/syncdaemon/test_localrescan.py

  • Committer: Tarmac
  • Author(s): guillermo.gonzalez at canonical
  • Date: 2010-04-12 21:23:35 UTC
  • mfrom: (487.2.1 local_rescan-only-active-volumes)
  • Revision ID: dobey@wayofthemonkey.com-20100412212335-l91v7xu00jz3ytpl
Avoid scaning "inactive" (unsubscribed UDFs) volumes during initial local rescan.

Show diffs side-by-side

added added

removed removed

Lines of Context:
338
338
        d.addCallback(check)
339
339
        return d
340
340
 
 
341
    @defer.inlineCallbacks
 
342
    def test_start_with_udf_unsubscribed(self):
 
343
        """LR start() having removed UDFs."""
 
344
        unsub_vol = self.volumes.pop(0)
 
345
        path_idx = self.expected.index(unsub_vol.path)
 
346
        unsub_path = self.expected.pop(path_idx)
 
347
        assert unsub_vol.path == unsub_path
 
348
        self.fsm.vm.unsubscribe_udf(unsub_vol.volume_id)
 
349
        toscan = []
 
350
        def f():
 
351
            """helper"""
 
352
            for _, path, _, _, udfmode in self.lr._queue:
 
353
                toscan.append(path)
 
354
            return defer.succeed(None)
 
355
 
 
356
        self.lr._queue_scan = f
 
357
        yield self.lr.start()
 
358
        self.assertEqual(self.expected, sorted(toscan))
 
359
 
341
360
 
342
361
class TwistedBase(BaseTestCase):
343
362
    """Base class for twisted tests."""