Example #1
0
 def test_walk_ids_ignore_related(self):
     case_id = uuid.uuid4().hex
     parent_case_id = uuid.uuid4().hex
     grandparent_case_id = uuid.uuid4().hex
     structure = CaseStructure(
         case_id=case_id,
         relationships=[
             CaseRelationship(CaseStructure(
                 case_id=parent_case_id,
                 relationships=[
                     CaseRelationship(CaseStructure(case_id=grandparent_case_id))
                 ]))
         ]
     )
     structure.walk_related = False
     self.assertEqual(
         [case_id],
         list(structure.walk_ids())
     )
     structure.walk_related = True
     structure.relationships[0].related_structure.walk_related = False
     self.assertEqual(
         [case_id, parent_case_id],
         list(structure.walk_ids())
     )
Example #2
0
 def test_walk_ids_ignore_related(self):
     case_id = uuid.uuid4().hex
     parent_case_id = uuid.uuid4().hex
     grandparent_case_id = uuid.uuid4().hex
     structure = CaseStructure(
         case_id=case_id,
         indices=[
             CaseIndex(CaseStructure(
                 case_id=parent_case_id,
                 indices=[
                     CaseIndex(CaseStructure(case_id=grandparent_case_id))
                 ]))
         ]
     )
     structure.walk_related = False
     self.assertEqual(
         [case_id],
         list(structure.walk_ids())
     )
     structure.walk_related = True
     structure.indices[0].related_structure.walk_related = False
     self.assertEqual(
         [case_id, parent_case_id],
         list(structure.walk_ids())
     )
Example #3
0
 def test_walk_ids(self):
     case_id = uuid.uuid4().hex
     parent_case_id = uuid.uuid4().hex
     grandparent_case_id = uuid.uuid4().hex
     structure = CaseStructure(
         case_id=case_id,
         indices=[
             CaseIndex(
                 CaseStructure(
                     case_id=parent_case_id, indices=[CaseIndex(CaseStructure(case_id=grandparent_case_id))]
                 )
             )
         ],
     )
     self.assertEqual([case_id, parent_case_id, grandparent_case_id], list(structure.walk_ids()))
Example #4
0
 def test_walk_ids(self):
     case_id = uuid.uuid4().hex
     parent_case_id = uuid.uuid4().hex
     grandparent_case_id = uuid.uuid4().hex
     structure = CaseStructure(
         case_id=case_id,
         indices=[
             CaseIndex(
                 CaseStructure(
                     case_id=parent_case_id,
                     indices=[
                         CaseIndex(
                             CaseStructure(case_id=grandparent_case_id))
                     ]))
         ])
     self.assertEqual([case_id, parent_case_id, grandparent_case_id],
                      list(structure.walk_ids()))
Example #5
0
 def test_walk_ids(self):
     case_id = uuid.uuid4().hex
     parent_case_id = uuid.uuid4().hex
     grandparent_case_id = uuid.uuid4().hex
     structure = CaseStructure(
         case_id=case_id,
         relationships=[
             CaseRelationship(
                 CaseStructure(
                     case_id=parent_case_id,
                     relationships=[
                         CaseRelationship(
                             CaseStructure(case_id=grandparent_case_id))
                     ]))
         ])
     self.assertEqual([case_id, parent_case_id, grandparent_case_id],
                      list(structure.walk_ids()))
Example #6
0
 def test_walk_ids(self):
     case_id = uuid.uuid4().hex
     parent_case_id = uuid.uuid4().hex
     grandparent_case_id = uuid.uuid4().hex
     structure = CaseStructure(
         case_id=case_id,
         relationships=[
             CaseRelationship(CaseStructure(
                 case_id=parent_case_id,
                 relationships=[
                     CaseRelationship(CaseStructure(case_id=grandparent_case_id))
                 ]))
         ]
     )
     self.assertEqual(
         [case_id, parent_case_id, grandparent_case_id],
         list(structure.walk_ids())
     )