Example #1
0
 def setUp(self):
     AvatarTestCase.setUp(self)
     self.avatar = CodehostingAvatar(self.aliceUserDict, None)
     # The logging system will try to get the id of avatar.transport, so
     # let's give it something to take the id of.
     self.avatar.transport = object()
     self.reactor = MockReactor()
     self.session = ExecOnlySession(self.avatar, self.reactor)
 def setUp(self):
     AvatarTestCase.setUp(self)
     self.avatar = CodehostingAvatar(self.aliceUserDict, None)
     # The logging system will try to get the id of avatar.transport, so
     # let's give it something to take the id of.
     self.avatar.transport = object()
     self.reactor = MockReactor()
     self.session = ExecOnlySession(self.avatar, self.reactor)
Example #3
0
    def setUp(self):
        AvatarTestCase.setUp(self)
        self.avatar = CodehostingAvatar(self.aliceUserDict, None)
        self.reactor = MockReactor()

        def lookup_template(command):
            if command == 'foo':
                return 'bar baz %(user_id)s'
            raise ForbiddenCommand("Not allowed to execute %r." % command)

        self.session = RestrictedExecOnlySession(self.avatar, self.reactor,
                                                 lookup_template)
    def setUp(self):
        AvatarTestCase.setUp(self)
        self.avatar = CodehostingAvatar(self.aliceUserDict, None)
        self.reactor = MockReactor()

        def lookup_template(command):
            if command == 'foo':
                return 'bar baz %(user_id)s'
            raise ForbiddenCommand("Not allowed to execute %r." % command)

        self.session = RestrictedExecOnlySession(
            self.avatar, self.reactor, lookup_template)
Example #5
0
 def setUp(self):
     AvatarTestCase.setUp(self)
     self.avatar = CodehostingAvatar(self.aliceUserDict, None)
 def setUp(self):
     AvatarTestCase.setUp(self)
     self.avatar = CodehostingAvatar(self.aliceUserDict, None)