def test_instance(self): # Test various instances. node = Node.instance('flow', {}) self.assertIsInstance(node, Flow) node = Node.instance('review', {}) self.assertIsInstance(node, Review)
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