Exemplo n.º 1
0
    def __init__(self, user, factory=None):
        factory = factory or APIFactory()
        fluidinfoUser = getUser(u'fluidinfo.com')
        self._user = user

        self._objects = factory.objects(fluidinfoUser)
        self._tagValues = factory.tagValues(fluidinfoUser)
Exemplo n.º 2
0
class APIFactoryTest(FluidinfoTestCase):

    resources = [('config', ConfigResource()),
                 ('store', DatabaseResource())]

    def setUp(self):
        super(APIFactoryTest, self).setUp()
        self.system = createSystemData()
        UserAPI().create([(u'user', u'secret', u'User', u'*****@*****.**')])
        self.user = getUser(u'user')
        self.factory = APIFactory()

    def testUsers(self):
        """L{APIFactory.users} returns a usable L{UserAPI} instance."""
        self.assertIsInstance(self.factory.users(), UserAPI)

    def testObjects(self):
        """L{APIFactory.objects} returns a usable L{ObjectAPI} instance."""
        self.assertIsInstance(self.factory.objects(self.user), ObjectAPI)

    def testNamespaces(self):
        """
        L{APIFactory.namespaces} returns a usable L{NamespaceAPI} instance.
        """
        self.assertIsInstance(self.factory.namespaces(self.user), NamespaceAPI)

    def testTags(self):
        """L{APIFactory.tags} returns a usable L{TagAPI} instance."""
        self.assertIsInstance(self.factory.tags(self.user), TagAPI)

    def testTagValues(self):
        """L{APIFactory.tagValues} returns a usable L{TagValueAPI} instance."""
        self.assertIsInstance(self.factory.tagValues(self.user), TagValueAPI)

    def testPermissions(self):
        """
        L{APIFactory.permissions} returns a usable L{PermissionAPI} instance.
        """
        self.assertIsInstance(self.factory.permissions(self.user),
                              PermissionAPI)

    def testPermissionCheckers(self):
        """
        L{APIFactory.permissionCheckers} returns a usable
        L{PermissionCheckerAPI} instance.
        """
        self.assertIsInstance(self.factory.permissionCheckers(),
                              PermissionCheckerAPI)

    def testRecentActivity(self):
        """
        L{APIFactory.recentActivity} returns a usable L{RecentActivityAPI}
        instance.
        """
        self.assertIsInstance(self.factory.recentActivity(), RecentActivityAPI)
Exemplo n.º 3
0
class APIFactoryTest(FluidinfoTestCase):

    resources = [('config', ConfigResource()), ('store', DatabaseResource())]

    def setUp(self):
        super(APIFactoryTest, self).setUp()
        self.system = createSystemData()
        UserAPI().create([(u'user', u'secret', u'User', u'*****@*****.**')])
        self.user = getUser(u'user')
        self.factory = APIFactory()

    def testUsers(self):
        """L{APIFactory.users} returns a usable L{UserAPI} instance."""
        self.assertIsInstance(self.factory.users(), UserAPI)

    def testObjects(self):
        """L{APIFactory.objects} returns a usable L{ObjectAPI} instance."""
        self.assertIsInstance(self.factory.objects(self.user), ObjectAPI)

    def testNamespaces(self):
        """
        L{APIFactory.namespaces} returns a usable L{NamespaceAPI} instance.
        """
        self.assertIsInstance(self.factory.namespaces(self.user), NamespaceAPI)

    def testTags(self):
        """L{APIFactory.tags} returns a usable L{TagAPI} instance."""
        self.assertIsInstance(self.factory.tags(self.user), TagAPI)

    def testTagValues(self):
        """L{APIFactory.tagValues} returns a usable L{TagValueAPI} instance."""
        self.assertIsInstance(self.factory.tagValues(self.user), TagValueAPI)

    def testPermissions(self):
        """
        L{APIFactory.permissions} returns a usable L{PermissionAPI} instance.
        """
        self.assertIsInstance(self.factory.permissions(self.user),
                              PermissionAPI)

    def testPermissionCheckers(self):
        """
        L{APIFactory.permissionCheckers} returns a usable
        L{PermissionCheckerAPI} instance.
        """
        self.assertIsInstance(self.factory.permissionCheckers(),
                              PermissionCheckerAPI)

    def testRecentActivity(self):
        """
        L{APIFactory.recentActivity} returns a usable L{RecentActivityAPI}
        instance.
        """
        self.assertIsInstance(self.factory.recentActivity(), RecentActivityAPI)
Exemplo n.º 4
0
 def __init__(self, user, factory=None):
     self._user = user
     self._factory = factory or APIFactory()
Exemplo n.º 5
0
 def setUp(self):
     super(APIFactoryTest, self).setUp()
     self.system = createSystemData()
     UserAPI().create([(u'user', u'secret', u'User', u'*****@*****.**')])
     self.user = getUser(u'user')
     self.factory = APIFactory()
Exemplo n.º 6
0
 def setUp(self):
     super(APIFactoryTest, self).setUp()
     self.system = createSystemData()
     UserAPI().create([(u'user', u'secret', u'User', u'*****@*****.**')])
     self.user = getUser(u'user')
     self.factory = APIFactory()
Exemplo n.º 7
0
 def __init__(self, factory=None):
     self._factory = factory or APIFactory()