def get_node_from_user(self, user_id, node_id):
        """Get node info from its id and the user, no matter the volume.

        Note that in this case the content for the node is not returned.
        """
        user = self._get_user(user_id)
        node = services.get_node_for_shard(node_id, user.shard_id)
        return self._process_node(node)
    def get_node_from_user(self, user_id, node_id):
        """Get node info from its id and the user, no matter the volume.

        Note that in this case the content for the node is not returned.
        """
        user = self._get_user(user_id)
        node = services.get_node_for_shard(node_id, user.shard_id)
        return self._process_node(node)
 def test_get_node_for_shard(self):
     """Test the get_node_for_shard function."""
     user1 = self.obj_factory.make_user(
         1, u"User 1", u"User 1", MAX_STORAGE_BYTES, shard_id=u"shard1")
     node = user1.volume().root.make_file(u"test file")
     new_node = get_node_for_shard(node.id, u'shard1')
     self.assertEquals(node.id, new_node.id)
     self.assertEquals(node.parent_id, new_node.parent_id)
     self.assertEquals(node.name, new_node.name)
     self.assertEquals(node.path, new_node.path)
Example #4
0
 def test_get_node_for_shard(self):
     """Test the get_node_for_shard function."""
     user1 = self.obj_factory.make_user(1,
                                        u"User 1",
                                        u"User 1",
                                        MAX_STORAGE_BYTES,
                                        shard_id=u"shard1")
     node = user1.volume().root.make_file(u"test file")
     new_node = get_node_for_shard(node.id, u'shard1')
     self.assertEquals(node.id, new_node.id)
     self.assertEquals(node.parent_id, new_node.parent_id)
     self.assertEquals(node.name, new_node.name)
     self.assertEquals(node.path, new_node.path)