def test_respond_model_get_upstream(): mm = MRA_Module(testing=True) egfr = sts.Agent('EGFR', db_refs={'HGNC': '3236', 'TEXT': 'EGFR'}) kras = sts.Agent('KRAS', db_refs={'HGNC': '6407', 'TEXT': 'KRAS'}) stmts = [sts.Activation(egfr, kras)] model_id = mm.mra.new_model(stmts) kras_term = ekb_from_agent(kras) msg = KQMLList('MODEL-GET-UPSTREAM') msg.sets('target', kras_term) msg.set('model-id', str(model_id)) reply = mm.respond_model_get_upstream(msg) ups = reply.get('upstream') assert(len(ups) == 1)
def test_agent_to_ekb(): egfr = Agent('EGFR', db_refs={'HGNC': '3236', 'TEXT': 'EGFR'}) term = ekb_from_agent(egfr) egfr_out = get_target(term) assert (isinstance(egfr_out, Agent)) assert (egfr_out.name == 'EGFR')