示例#1
0
class SecureRecentActivityAPIWithBrokenCacheTest(RecentActivityAPITestMixin,
                                                 FluidinfoTestCase):

    resources = [('cache', BrokenCacheResource()), ('client', IndexResource()),
                 ('config', ConfigResource()), ('log', LoggingResource()),
                 ('store', DatabaseResource())]

    def setUp(self):
        super(SecureRecentActivityAPIWithBrokenCacheTest, self).setUp()
        createSystemData()
        UserAPI().create([(u'user', u'secret', u'User', u'*****@*****.**')])
        self.user = getUser(u'user')
        self.recentActivity = SecureRecentActivityAPI(self.user)

    def getObjectAPI(self, user):
        """Get an L{CachingObjectAPI} instance for the specified user.

        @param user: The L{User} to configure the L{CachingObjectAPI}
            instance.
        @return: An L{CachingObjectAPI} instance.
        """
        return CachingObjectAPI(user)

    def getTagValueAPI(self, user):
        """Get a L{TagValueAPI} instance for the specified user.

        @param user: The L{User} to configure the L{TagValueAPI} instance.
        @return: A L{TagValueAPI} instance.
        """
        return CachingTagValueAPI(user)
示例#2
0
class CachingUserAPIWithBrokenCacheTest(UserAPITestMixin, FluidinfoTestCase):

    resources = [('cache', BrokenCacheResource()),
                 ('config', ConfigResource()), ('log', LoggingResource()),
                 ('store', DatabaseResource())]

    def setUp(self):
        super(CachingUserAPIWithBrokenCacheTest, self).setUp()
        self.system = createSystemData()
        self.users = CachingUserAPI()
示例#3
0
class CachingPermissionAPIWithBrokenCacheTest(PermissionAPITestMixin,
                                              FluidinfoTestCase):

    resources = [('cache', BrokenCacheResource()),
                 ('config', ConfigResource()), ('log', LoggingResource()),
                 ('store', DatabaseResource())]

    def setUp(self):
        super(CachingPermissionAPIWithBrokenCacheTest, self).setUp()
        self.system = createSystemData()
        UserAPI().create([(u'username', u'password', u'User',
                           u'*****@*****.**')])
        self.user = getUser(u'username')
        self.permissions = CachingPermissionAPI(self.user)
示例#4
0
class SecureObjectAPIWithBrokenCacheTest(ObjectAPITestMixin,
                                         SecureObjectAPITestMixin,
                                         FluidinfoTestCase):

    resources = [('cache', BrokenCacheResource()),
                 ('client', IndexResource()),
                 ('config', ConfigResource()),
                 ('log', LoggingResource()),
                 ('store', DatabaseResource())]

    def setUp(self):
        super(SecureObjectAPIWithBrokenCacheTest, self).setUp()
        self.system = createSystemData()
        UserAPI().create([(u'user', u'password', u'User',
                           u'*****@*****.**')])
        self.user = getUser(u'user')
        self.objects = SecureObjectAPI(self.user)