~ubuntuone-control-tower/ubuntuone-client/trunk

« back to all changes in this revision

Viewing changes to contrib/testing/testcase.py

  • Committer: Tarmac
  • Author(s): Natalia B. Bidart
  • Date: 2011-08-26 16:34:45 UTC
  • mfrom: (1111.1.10 clean-test-run)
  • Revision ID: tarmac-20110826163445-sa6o9xc2vqykcyx0
- Only make the link if it does not exists on disk (LP: #833812).
- Fixing or skipping tests in windows. Look for tag 'u1-windows-skipped-test' to track all the bugs related to skipped tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
import shutil
25
25
import sys
26
26
 
 
27
from twisted.internet import defer
 
28
from twisted.trial.unittest import TestCase as TwistedTestCase
 
29
from ubuntuone.devtools.testcase import skipIfOS
 
30
from zope.interface import implements
 
31
from zope.interface.verify import verifyObject
 
32
 
27
33
from ubuntuone.syncdaemon import (
28
34
    config,
29
35
    action_queue,
44
50
    set_dir_readwrite,
45
51
    stat_path,
46
52
)
 
53
 
47
54
logger.init()
48
 
from twisted.internet import defer
49
 
from twisted.trial.unittest import TestCase as TwistedTestCase
50
 
from zope.interface import implements
51
 
from zope.interface.verify import verifyObject
52
 
 
53
55
 
54
56
FAKED_CREDENTIALS = {'consumer_key': 'faked_consumer_key',
55
57
                     'consumer_secret': 'faked_consumer_secret',
220
222
        self.external = FakeExternalInterface()
221
223
        self.lr = local_rescan.LocalRescan(self.vm, self.fs,
222
224
                                           self.event_q, self.action_q)
 
225
 
 
226
        self.eventlog_listener = None
223
227
        self.status_listener = FakeStatusListener()
224
228
 
225
229
    def _connect_aq(self, _):
363
367
        config._user_config = None
364
368
        config.get_user_config(config_file=self.config_file)
365
369
 
 
370
        self.log = logging.getLogger("ubuntuone.SyncDaemon.TEST")
 
371
        self.log.info("starting test %s.%s", self.__class__.__name__,
 
372
                      self._testMethodName)
 
373
 
366
374
 
367
375
class FakeMainTestCase(BaseTwistedTestCase):
368
376
    """A testcase that starts up a Main instance."""
371
379
    def setUp(self):
372
380
        """Setup the infrastructure for the test."""
373
381
        yield super(FakeMainTestCase, self).setUp()
374
 
        self.log = logging.getLogger("ubuntuone.SyncDaemon.TEST")
375
 
        self.log.info("starting test %s.%s", self.__class__.__name__,
376
 
                      self._testMethodName)
377
382
        self.timeout = 2
378
383
        self.data_dir = self.mktemp('data_dir')
379
384
        self.partials_dir = self.mktemp('partials')
484
489
    def __getattr__(self, name):
485
490
        """Any attribute is a no-op."""
486
491
        return lambda *args, **kwargs: None
 
492
 
 
493
 
 
494
skip_if_win32_and_uses_metadata_older_than_5 = \
 
495
    skipIfOS('win32',
 
496
             'In windows there is no need to migrate metadata older than v5.')
 
497
 
 
498
 
 
499
skip_if_win32_and_uses_readonly = \
 
500
    skipIfOS('win32', 'Can not test RO shares until bug #820350 is resolved.')
 
501
 
 
502
 
 
503
skip_if_win32_missing_fs_event = \
 
504
    skipIfOS('win32', 'Fails due to missing/out of order FS events, '
 
505
                      'see bug #820598.')