def init_db(self, parent_type, child_type): """ create parent and multiple children then create a link from parent to every child """ self.parent = Node(self.handler, parent_type) self.children = [ Node(self.handler, child_type) for x in range(0, self.SIZE) ] for node in self.children: Link(self.handler, self.parent.node, node.node, child_type.upper())
def setUp(self): """ Tests for findall() and findall_withUserID() Create 1 user, 1 issue and 5 value nodes User ranks values 0, 3, 4 Issue has values 0, 1, 4 """ self.handler = Handler() self.issue = Node(self.handler, "TestIssue") self.nodes = [Node(self.handler, "TestValue") for i in range(0, 5)] self.user = User(self.handler) Link(self.handler, self.issue.node, self.nodes[0].node, "HAS") Link(self.handler, self.issue.node, self.nodes[1].node, "HAS") Link(self.handler, self.issue.node, self.nodes[4].node, "HAS") Rank(self.handler, self.user.node, self.nodes[0].node, 1) Rank(self.handler, self.user.node, self.nodes[3].node, 2) Rank(self.handler, self.user.node, self.nodes[4].node, -1)
def setUp(self): self.app = app.test_client() self.handler = Handler() self.user_id = str(uuid.uuid4()) self.node = Node(self.handler, "Value") self.endpoint = "/api/rank/value" self.data = dict(user_id=self.user_id, node_id=self.node.node_id, rank=self.rank, issue_id=str(uuid.uuid4()))
def setUp(self): super(GetPolicyTest, self).setUp() self.node = Node(self.handler, "Policy") self.endpoint = "/api/policy"
def setUp(self): super(GetObjectiveTest, self).setUp() self.node = Node(self.handler, "Objective") self.endpoint = "/api/objective"
def setUp(self): super(GetValueTest, self).setUp() self.node = Node(self.handler, "Value") self.endpoint = "/api/value"
def setUp(self): super(GetIssueTest, self).setUp() self.node = Node(self.handler, "Issue") self.endpoint = "/api/issue"
def setUp(self): super(ObjectivePolicyMapTest, self).setUp() self.endpoint = "/api/map/objective/policy" self.src = Node(self.handler, "Objective") self.dst = Node(self.handler, "Policy") self.postSetUp()
def setUp(self): super(ValueObjectiveMapTest, self).setUp() self.endpoint = "/api/map/value/objective" self.src = Node(self.handler, "Value") self.dst = Node(self.handler, "Objective") self.postSetUp()
def setUp(self): super(PolicyRankTest, self).setUp() self.node = Node(self.handler, "Policy") self.endpoint = "/api/rank/policy" self.data = self.parameters()
def setUp(self): super(ObjectiveRankTest, self).setUp() self.node = Node(self.handler, "Objective") self.endpoint = "/api/rank/objective" self.data = self.parameters()
def setUp(self): super(ValueRankTest, self).setUp() self.node = Node(self.handler, "Value") self.endpoint = "/api/rank/value" self.data = self.parameters()
def init_db(self): self.children = [ Node(self.handler, "Community") for x in range(0, self.SIZE) ]