def testHandlingSingleInteractionDataWritingDiffNamesBlank(): mca = MedeinaCumulativeApplication("dir") mca.linkEvidence = {("S2", "S1"): [1, 3], ("S3", "S1"): [4]} mca.links = {1: {"dId": 2}, 2: {"dId": 1}, 3: {"dId": 1}, 4: {"dId": 2}} mca.datasets = {1: {}, 2: {}} mca.stringNames = {1: "Spec1", 2: "Spec2", 3: "Spec3", 4: "Spec4"} mca.interactionWeb = {IDTRACKER: 5, 2: {1: [1, 3], 3: [2]}, 3: {1: [4]}} evidencingIDs = [] invertedLinkIndex = mca.buildLinkIndex() fileDumpStruct = mca.handleSingleInteractionEvidence( evidencingIDs, invertedLinkIndex, "S2", "S1") assert fileDumpStruct == []
def testBuildingLinkIndex(): mca = MedeinaCumulativeApplication("dir") mca.linkEvidence = {("Spec1", "Spec2"): [1, 2], ("Spec3", "Spec4"): [3]} mca.stringNames = {1: "Spec1", 2: "Spec2", 3: "Spec3", 4: "Spec4"} mca.interactionWeb = {IDTRACKER: 5, 2: {1: [1, 3, 5], 3: [6]}, 3: {1: [2]}} linkIndex = mca.buildLinkIndex() assert linkIndex == { 1: ("Spec2", "Spec1"), 2: ("Spec3", "Spec1"), 3: ("Spec2", "Spec1"), } assert IDTRACKER in mca.interactionWeb