Exemplo n.º 1
0
def test_get_belief_package2():
    st1 = Phosphorylation(None, Agent('A1'), evidence=[ev1])
    st2 = Phosphorylation(None, Agent('A'), evidence=[ev2])
    st1.supported_by = [st2]
    st2.supports = [st1]
    package = _get_belief_package(st1)
    assert len(package) == 1
    assert package[0].statement_key == st1.matches_key()
    assert len(package[0].evidences) == 1, package[0][1]
    assert package[0].evidences[0].source_api == 'reach'
    package = _get_belief_package(st2)
    assert len(package) == 2, package
    assert package[0].statement_key == st1.matches_key()
    assert package[1].statement_key == st2.matches_key()
Exemplo n.º 2
0
def test_get_belief_package2():
    st1 = Phosphorylation(None, Agent('A1'), evidence=[ev1])
    st2 = Phosphorylation(None, Agent('A'), evidence=[ev2])
    st1.supported_by = [st2]
    st2.supports = [st1]
    package = _get_belief_package(st1)
    assert len(package) == 1
    assert package[0].statement_key == st1.matches_key()
    assert len(package[0].evidences) == 1, package[0][1]
    assert package[0].evidences[0].source_api == 'reach'
    package = _get_belief_package(st2)
    assert len(package) == 2, package
    assert package[0].statement_key == st1.matches_key()
    assert package[1].statement_key == st2.matches_key()
Exemplo n.º 3
0
def test_get_belief_package3():
    st1 = Phosphorylation(Agent('B'), Agent('A1'), evidence=[ev1])
    st2 = Phosphorylation(None, Agent('A1'), evidence=[ev2])
    st3 = Phosphorylation(None, Agent('A'), evidence=[ev4])
    st1.supported_by = [st2, st3]
    st2.supported_by = [st3]
    st2.supports = [st1]
    st3.supports = [st1, st2]
    package = _get_belief_package(st1)
    assert len(package) == 1
    package = _get_belief_package(st2)
    assert len(package) == 2
    package = _get_belief_package(st3)
    assert len(package) == 3
    sources = [pkg.evidences[0].source_api for pkg in package]
    assert sources == ['reach', 'trips', 'biopax']
Exemplo n.º 4
0
def test_get_belief_package1():
    st1 = Phosphorylation(None, Agent('a'))
    st1.belief = 0.53
    package = _get_belief_package(st1)
    assert(len(package) == 1)
    assert(package[0][0] == 0.53)
    assert(package[0][1] == st1.matches_key())
Exemplo n.º 5
0
def test_get_belief_package3():
    st1 = Phosphorylation(Agent('B'), Agent('A1'), evidence=[ev1])
    st2 = Phosphorylation(None, Agent('A1'), evidence=[ev2])
    st3 = Phosphorylation(None, Agent('A'), evidence=[ev4])
    st1.supported_by = [st2, st3]
    st2.supported_by = [st3]
    st2.supports = [st1]
    st3.supports = [st1, st2]
    package = _get_belief_package(st1)
    assert len(package) == 1
    package = _get_belief_package(st2)
    assert len(package) == 2
    package = _get_belief_package(st3)
    assert len(package) == 3
    sources = [pkg.evidences[0].source_api for pkg in package]
    assert sources == ['reach', 'trips', 'biopax']
Exemplo n.º 6
0
def test_get_belief_package2():
    st1 = Phosphorylation(None, Agent('A1'))
    st2 = Phosphorylation(None, Agent('A'))
    st1.supported_by = [st2]
    st2.supports = [st1]
    st1.belief = 0.8
    st2.belief = 0.6
    package = _get_belief_package(st1)
    assert(len(package) == 1)
    assert(package[0][0] == 0.8)
    assert(package[0][1] == st1.matches_key())
    package = _get_belief_package(st2)
    assert(len(package) == 2)
    assert(package[0][0] == 0.8)
    assert(package[0][1] == st1.matches_key())
    assert(package[1][0] == 0.6)
    assert(package[1][1] == st2.matches_key())
Exemplo n.º 7
0
def test_get_belief_package3():
    st1 = Phosphorylation(Agent('B'), Agent('A1'))
    st2 = Phosphorylation(None, Agent('A1'))
    st3 = Phosphorylation(None, Agent('A'))
    st1.supported_by = [st2, st3]
    st2.supported_by = [st3]
    st2.supports = [st1]
    st3.supports = [st1, st2]
    st1.belief = 0.8
    st2.belief = 0.6
    st3.belief = 0.7
    package = _get_belief_package(st1)
    assert(len(package) == 1)
    assert(set([p[0] for p in package]) == set([0.8]))
    package = _get_belief_package(st2)
    assert(len(package) == 2)
    assert(set([p[0] for p in package]) == set([0.6, 0.8]))
    package = _get_belief_package(st3)
    assert(len(package) == 3)
    assert(set([p[0] for p in package]) == set([0.6, 0.7, 0.8]))
Exemplo n.º 8
0
def test_get_belief_package1():
    st1 = Phosphorylation(None, Agent('a'), evidence=[ev1])
    package = _get_belief_package(st1)
    assert len(package) == 1
    assert package[0][0] == st1.matches_key()
Exemplo n.º 9
0
def test_get_belief_package1():
    st1 = Phosphorylation(None, Agent('a'), evidence=[ev1])
    package = _get_belief_package(st1)
    assert len(package) == 1
    assert package[0][0] == st1.matches_key()