Exemplo n.º 1
0
class EvidenceTestCase(unittest.TestCase):
    def setUp(self):
        """
        Because _process_evidence_view uses
        self.rawdir to find the evidence file,
        the defaults are overriden here to
        point to our test file
        Note the file name must match what is in
        that method - evidence_view
        """
        self.test_util = TestUtils()
        self.mgi = MGI('rdf_graph', True)
        self.mgi.rawdir = os.path.join(os.path.dirname(__file__),
                                       'resources/mgi')
        self.mgi.idhash['annot']['6901981'] = ':association'

    def tearDown(self):
        self.mgi = None
        return

    def test_sex_specificity_model(self):
        self.mgi.graph = RDFGraph(True)  # Reset graph
        self.mgi._process_evidence_view(limit=None)
        logger.debug("Reference graph: %s",
                     self.mgi.graph.serialize(format="turtle").decode("utf-8"))
        expected_triples = """
        :association RO:0002558 ECO:0000006 ;
            dc:source J:74619 ;
            :has_sex_specificity PATO:0000384 .

        J:74619 a IAO:0000310 .
        """
        self.assertTrue(
            self.test_util.test_graph_equality(expected_triples,
                                               self.mgi.graph))
Exemplo n.º 2
0
class MGITestCase(SourceTestCase):
    def setUp(self):
        self.source = MGI('rdf_graph', True)
        self.source.settestonly(True)
        self._setDirToSource()
        return

    def tearDown(self):
        self.source = None
        return
Exemplo n.º 3
0
class MGITestCase(SourceTestCase):

    def setUp(self):
        self.source = MGI('rdf_graph', True)
        self.source.settestonly(True)
        self._setDirToSource()
        return

    def tearDown(self):
        self.source = None
        return
Exemplo n.º 4
0
 def setUp(self):
     """
     Because _process_evidence_view uses
     self.rawdir to find the evidence file,
     the defaults are overriden here to
     point to our test file
     Note the file name must match what is in
     that method - evidence_view
     """
     self.test_util = TestUtils()
     self.mgi = MGI('rdf_graph', True)
     self.mgi.rawdir = os.path.join(os.path.dirname(__file__),
                                    'resources/mgi')
     self.mgi.idhash['annot']['6901981'] = ':association'
Exemplo n.º 5
0
 def setUp(self):
     """
     Because _process_evidence_view uses
     self.rawdir to find the evidence file,
     the defaults are overriden here to
     point to our test file
     Note the file name must match what is in
     that method - evidence_view
     """
     self.test_util = TestUtils()
     self.mgi = MGI('rdf_graph', True)
     self.mgi.rawdir = os.path.join(os.path.dirname(__file__), 'resources/mgi')
     self.mgi.idhash['annot']['6901981'] = ':association'
Exemplo n.º 6
0
class EvidenceTestCase(unittest.TestCase):

    def setUp(self):
        """
        Because _process_evidence_view uses
        self.rawdir to find the evidence file,
        the defaults are overriden here to
        point to our test file
        Note the file name must match what is in
        that method - evidence_view
        """
        self.test_util = TestUtils()
        self.mgi = MGI('rdf_graph', True)
        self.mgi.rawdir = os.path.join(
            os.path.dirname(__file__), 'resources/mgi')
        self.mgi.idhash['annot']['6901981'] = ':association'

    def tearDown(self):
        self.mgi = None
        return

    def test_sex_specificity_model(self):
        self.mgi.graph = RDFGraph(True)  # Reset graph

        self.mgi._process_evidence_view(limit=None)
        logger.debug(
            "Reference graph: %s",
            self.mgi.graph.serialize(format="turtle").decode("utf-8"))
        expected_triples = """
        :association RO:0002558 ECO:0000006 ;
            dc:source J:74619 ;
            :has_sex_specificity PATO:0000384 .

        J:74619 a IAO:0000310 .
        """
        self.assertTrue(self.test_util.test_graph_equality(
            expected_triples, self.mgi.graph))
Exemplo n.º 7
0
 def setUp(self):
     self.source = MGI()
     self.source.settestonly(True)
     self.source.setnobnodes(True)
     self._setDirToSource()
     return
Exemplo n.º 8
0
 def setUp(self):
     self.source = MGI('rdf_graph', True)
     self.source.settestonly(True)
     self._setDirToSource()
     return
Exemplo n.º 9
0
 def setUp(self):
     self.source = MGI('rdf_graph', True)
     self.source.settestonly(True)
     self._setDirToSource()
     return