Skip to content

Commit

Permalink
Add unit tests for enrich function
Browse files Browse the repository at this point in the history
References #11
  • Loading branch information
cthoyt committed Aug 18, 2017
1 parent 65362bf commit d193abc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/bio2bel_mirtarbase/enrich.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-

from pybel_tools import pipeline


@pipeline.in_place_mutator
def enrich_proteins(graph):
"""Adds all of the miRNA inhibitors of the proteins in the graph
:param pybel.BELGraph graph: A BEL graph
"""
raise NotImplemented
23 changes: 23 additions & 0 deletions tests/test_enrich.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-

import unittest

from bio2bel_mirtarbase.enrich import enrich_proteins
from pybel import BELGraph
from pybel.constants import PROTEIN, MIRNA

c = PROTEIN, 'HGNC', 'HIF1A'
t1 = MIRNA, 'MTB', 'MIRT000002'


class TestEnrich(unittest.TestCase):
def test_enrich(self):
g = BELGraph()

g.add_simple_node(*c)

self.assertEqual(1, g.number_of_nodes())

enrich_proteins(g)

self.assertTrue(g.has_edge(t1, c))

0 comments on commit d193abc

Please sign in to comment.