Example #1
0
File: web.py Project: strk/buildbot
 def __init__(self, args={}):
     self.args = args
     self.site = Mock()
     self.site.buildbot_service = Mock()
     self.site.buildbot_service.master = Mock()
     self.site.buildbot_service.master.change_svc = Mock()
     Mock.__init__(self)
Example #2
0
    def __init__(self, args=None, content=""):
        Mock.__init__(self, spec=server.Request)

        if args is None:
            args = {}

        self.args = args
        self.content = StringIO(content)
        self.site = Mock(spec=server.Site)
        webstatus = baseweb.WebStatus(site=self.site)
        self.site.buildbot_service = webstatus
        self.uri = "/"
        self.prepath = []
        self.method = "GET"
        self.received_headers = {}
        master = webstatus.master = fakemaster.make_master()

        webstatus.setUpJinja2()

        self.addedChanges = []

        def addChange(**kwargs):
            self.addedChanges.append(kwargs)
            return defer.succeed(Mock())

        master.addChange = addChange

        self.deferred = defer.Deferred()
Example #3
0
    def __init__(self, account, *args):
        Mock.__init__(self, *args)
        ConnectionHandlersBase.__init__(self)

        self.name = account
        self.connected = 2
        self.mood = {}
        self.activity = {}
        self.tune = {}
        self.blocked_contacts = {}
        self.blocked_groups = {}
        self.sessions = {}

        gajim.interface.instances[account] = {"infos": {}, "disco": {}, "gc_config": {}, "search": {}}
        gajim.interface.minimized_controls[account] = {}
        gajim.contacts.add_account(account)
        gajim.groups[account] = {}
        gajim.gc_connected[account] = {}
        gajim.automatic_rooms[account] = {}
        gajim.newly_added[account] = []
        gajim.to_be_removed[account] = []
        gajim.nicks[account] = gajim.config.get_per("accounts", account, "name")
        gajim.block_signed_in_notifications[account] = True
        gajim.sleeper_state[account] = 0
        gajim.encrypted_chats[account] = []
        gajim.last_message_time[account] = {}
        gajim.status_before_autoaway[account] = ""
        gajim.transport_avatar[account] = {}
        gajim.gajim_optional_features[account] = []
        gajim.caps_hash[account] = ""

        gajim.connections[account] = self
Example #4
0
 def __init__(self, addr, s=None):
     logging.info("initializing connector")
     global connector_cpt
     self.desc = connector_cpt
     connector_cpt += 1
     self.packet_cpt = 0
     self.addr = addr
     Mock.__init__(self)
Example #5
0
    def __init__(self, jid, account, *args):
        Mock.__init__(self, *args)

        self.jid = jid
        self.account = account

        self.parent_win = MockWindow({"get_active_control": self})
        self.session = None
Example #6
0
    def __init__(self, conn, jid, thread_id, type_):
        Mock.__init__(self)

        self.conn = conn
        self.jid = jid
        self.type = type_
        self.thread_id = thread_id

        if not self.thread_id:
            self.thread_id = "%0x" % random.randint(0, 10000)
Example #7
0
    def __init__(self, args={}):
        self.args = args
        self.site = Mock()
        self.site.buildbot_service = Mock()
        master = self.site.buildbot_service.master = Mock()

        self.addedChanges = []

        def addChange(**kwargs):
            self.addedChanges.append(kwargs)
            return defer.succeed(Mock())

        master.addChange = addChange

        Mock.__init__(self)
Example #8
0
    def __init__(self, args=None, content=""):
        Mock.__init__(self)

        if args is None:
            args = {}

        self.args = args
        self.content = StringIO(content)
        self.site = Mock()
        self.site.buildbot_service = Mock()
        self.uri = "/"
        self.prepath = []
        self.method = "GET"
        self.received_headers = {}

        self.deferred = defer.Deferred()
Example #9
0
    def __init__(self, args={}, content=""):
        Mock.__init__(self)

        self.args = args
        self.content = StringIO(content)
        self.site = Mock()
        self.site.buildbot_service = Mock()
        master = self.site.buildbot_service.master = Mock()

        self.addedChanges = []

        def addChange(**kwargs):
            self.addedChanges.append(kwargs)
            return defer.succeed(Mock())

        master.addChange = addChange

        self.deferred = defer.Deferred()
Example #10
0
    def __init__(self, *args):
        Mock.__init__(self, *args)
        gajim.interface = self
        self.msg_win_mgr = Mock()
        self.roster = Mock()

        self.remote_ctrl = None
        self.instances = {}
        self.minimized_controls = {}
        self.status_sent_to_users = Mock()

        if gajim.use_x:
            self.jabber_state_images = {"16": {}, "32": {}, "opened": {}, "closed": {}}

            import gtkgui_helpers

            gtkgui_helpers.make_jabber_state_images()
        else:
            self.jabber_state_images = {"16": Mock(), "32": Mock(), "opened": Mock(), "closed": Mock()}
Example #11
0
    def __init__(self, args={}, content=""):
        Mock.__init__(self)

        self.args = args
        self.content = StringIO(content)
        self.site = Mock()
        self.site.buildbot_service = Mock()
        master = self.site.buildbot_service.master = Mock()
        self.uri = "/"
        self.prepath = []
        self.method = "GET"
        self.received_headers = {}

        self.addedChanges = []

        def addChange(**kwargs):
            self.addedChanges.append(kwargs)
            return defer.succeed(Mock())

        master.addChange = addChange

        self.deferred = defer.Deferred()
Example #12
0
 def init(self, *args, **kwargs):
     Mock.__init__(self, spec=interface_class.names(), *args, **kwargs)
Example #13
0
 def __init__(self, *args):
     self.connect_succeeded = True
     IdleMock.__init__(self)
     Mock.__init__(self, *args)
Example #14
0
 def __init__(self, *args, **kwargs):
     self.value = ""
     Mock.__init__(self)
Example #15
0
 def __init__(self, *args):
     Mock.__init__(self, *args)
     self.window = Mock()
     self._controls = {}
Example #16
0
 def __init__(self, *args, **kwargs):
     Mock.__init__(self, IAirPlayServer.names(), *args, **kwargs)
Example #17
0
 def init(self, *args, **kwargs):
     Mock.__init__(self, spec=spec, *args, **kwargs)
Example #18
0
 def __init__(self):
     Mock.__init__(self, {"write": None, "get_transports_type": {}})
Example #19
0
 def __init__(self, *args, **kwargs):
     Mock.__init__(self, *args, **kwargs)
     self.builder = None
     self.properites = {}
Example #20
0
 def __init__(self, *args, **kwargs):
     Mock.__init__(self)
Example #21
0
 def __init__(self, *args):
     Mock.__init__(self, *args)
Example #22
0
    def __init__(self, sockobj):
        Mock.__init__(self)

        self.sockobj = sockobj
Example #23
0
 def __init__(self):
     Mock.__init__(self)
Example #24
0
 def __init__(self):
     Mock.__init__(self)
     ConnectionJingle.__init__(self)
     ConnectionSocks5Bytestream.__init__(self)
     ConnectionIBBytestream.__init__(self)
     self.connected = 2  # This tells gajim we are connected
Example #25
0
 def __init__(self, *args, **kwargs):
     self.data = [[]]
     self.nCols = 0
     self.nCurRow = 0
     Mock.__init__(self)