Ejemplo n.º 1
0
 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())
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 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()))
Ejemplo n.º 4
0
 def setUp(self):
     super(GetPolicyTest, self).setUp()
     self.node = Node(self.handler, "Policy")
     self.endpoint = "/api/policy"
Ejemplo n.º 5
0
 def setUp(self):
     super(GetObjectiveTest, self).setUp()
     self.node = Node(self.handler, "Objective")
     self.endpoint = "/api/objective"
Ejemplo n.º 6
0
 def setUp(self):
     super(GetValueTest, self).setUp()
     self.node = Node(self.handler, "Value")
     self.endpoint = "/api/value"
Ejemplo n.º 7
0
 def setUp(self):
     super(GetIssueTest, self).setUp()
     self.node = Node(self.handler, "Issue")
     self.endpoint = "/api/issue"
Ejemplo n.º 8
0
 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()
Ejemplo n.º 9
0
 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()
Ejemplo n.º 10
0
 def setUp(self):
     super(PolicyRankTest, self).setUp()
     self.node = Node(self.handler, "Policy")
     self.endpoint = "/api/rank/policy"
     self.data = self.parameters()
Ejemplo n.º 11
0
 def setUp(self):
     super(ObjectiveRankTest, self).setUp()
     self.node = Node(self.handler, "Objective")
     self.endpoint = "/api/rank/objective"
     self.data = self.parameters()
Ejemplo n.º 12
0
 def setUp(self):
     super(ValueRankTest, self).setUp()
     self.node = Node(self.handler, "Value")
     self.endpoint = "/api/rank/value"
     self.data = self.parameters()
Ejemplo n.º 13
0
 def init_db(self):
     self.children = [
         Node(self.handler, "Community") for x in range(0, self.SIZE)
     ]