Example #1
0
    def test_instance(self):
        # Test various instances.
        node = Node.instance('flow', {})
        self.assertIsInstance(node, Flow)

        node = Node.instance('review', {})
        self.assertIsInstance(node, Review)
Example #2
0
    def test_instance(self):
        # Test various instances.
        node = Node.instance('flow', {})
        self.assertIsInstance(node, Flow)

        node = Node.instance('review', {})
        self.assertIsInstance(node, Review)
Example #3
0
    def get_nodes(self, type, query_args={}):
        """
        Get a list of nodes.
        """
        endpoint = '/v3/educator/%ss' % (Node.TYPE_MAP[type])
        result = self.request(endpoint, query_args)

        nodes = []
        for data in result.response:
            node = Node.instance(type, data)
            nodes.append(node)

        return nodes
Example #4
0
    def get_nodes(self, type, query_args={}):
        """
        Get a list of nodes.
        """
        endpoint = '/v3/educator/%ss' % (Node.TYPE_MAP[type])
        result = self.request(endpoint, query_args)

        nodes = []
        for data in result.response:
            node = Node.instance(type, data)
            nodes.append(node)

        return nodes