~rmcbride/ubuntu/lucid/ubuntuone-client/fixucg

« back to all changes in this revision

Viewing changes to contrib/testing/testcase.py

  • Committer: Bazaar Package Importer
  • Author(s): Rodney Dawes
  • Date: 2009-07-16 17:00:00 UTC
  • mto: (17.1.1 ubuntuone-client)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20090716170000-tnnk149g57bxxo24
Tags: upstream-0.90.4
ImportĀ upstreamĀ versionĀ 0.90.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import logging
22
22
import os
23
23
import shutil
24
 
from warnings import warn
25
24
 
26
25
 
27
26
from ubuntuone.syncdaemon import (
38
37
    NM_STATE_CONNECTED,
39
38
    NM_STATE_DISCONNECTED,
40
39
)
41
 
from twisted.internet import defer, reactor
 
40
from twisted.internet import defer
42
41
from twisted.trial.unittest import TestCase as TwistedTestCase
43
42
from zope.interface import implements
44
43
 
155
154
        if path != getattr(self, '__root', None):
156
155
            os.chmod(os.path.dirname(path), 0755)
157
156
        os.chmod(path, 0755)
 
157
        # pylint: disable-msg=W0612
158
158
        for dirpath, dirs, files in os.walk(path):
159
159
            for dir in dirs:
160
160
                os.chmod(os.path.join(dirpath, dir), 0777)
235
235
        """ cleanup self.signal_receivers and returns a deferred """
236
236
        deferreds = []
237
237
        for match in self.signal_receivers:
238
 
            rule = str(match)
239
238
            d = defer.Deferred()
240
239
            def callback(*args):
241
240
                """ callback that accepts *args. """
263
262
        self.client = action_queue.ActionQueueProtocol()
264
263
        self.uploading = {}
265
264
        self.downloading = {}
 
265
        # pylint: disable-msg=C0103
266
266
        class UUID_Map(object):
267
267
            """mock uuid map"""
268
268
            def set(self, *args):
270
270
                pass
271
271
 
272
272
        self.uuid_map = UUID_Map()
273
 
        self.content_queue = action_queue.ContentQueue('CONTENT', self)
274
 
        self.meta_queue = action_queue.MetaQueue('META', self)
 
273
        self.content_queue = action_queue.RequestQueue('CONTENT', self)
 
274
        self.meta_queue = action_queue.RequestQueue('META', self)
275
275
 
276
276
    def connect(self, host=None, port=None, user_ssl=False):
277
277
        """ stub implementation """
328
328
 
329
329
    def answer_share(self, share_id, answer):
330
330
        """ stub implementation """
331
 
        d = defer.Deferred()
332
 
        reactor.callLater(0.2, d.callback, True)
333
 
        return d
 
331
        self.eq.push('AQ_ANSWER_SHARE_OK', share_id, answer)
334
332
 
335
333
    def create_share(self, *args):
336
334
        """ sutb implementation """
374
372
        self.remove_from_connection()
375
373
 
376
374
    @dbus.service.signal('org.freedesktop.NetworkManager', signature='i')
 
375
    # pylint: disable-msg=C0103
377
376
    def StateChanged(self, state):
378
377
        """ Fire DBus signal StatusChanged. """
379
378
        pass
389
388
    @dbus.service.method(dbus.PROPERTIES_IFACE,
390
389
                         in_signature='ss', out_signature='v',
391
390
                         async_callbacks=('reply_handler', 'error_handler'))
 
391
    # pylint: disable-msg=C0103
392
392
    def Get(self, interface, propname, reply_handler=None, error_handler=None):
393
393
        """
394
394
        Fake dbus's Get method to get at the State property