def test_muscles1(self): w = Worm() w.muscle(Muscle(name='MDL08')) w.muscle(Muscle(name='MDL15')) w.save() self.assertIn(Muscle(name='MDL08'), list(Worm().muscles())) self.assertIn(Muscle(name='MDL15'), list(Worm().muscles()))
def test_verify_connections_have_evidence(self): """ For each connection in PyOpenWorm, verify that there is supporting evidence. """ net = Worm().get_neuron_network() connections = list(net.synapses()) evcheck = [] for c in connections: has_evidence = len(self.get_supporting_evidence(c)) evcheck.append(has_evidence) self.assertTrue(0 not in evcheck)
def test_verify_muslces_have_evidence(self): """ For each muscle in PyOpenWorm, verify that there is supporting evidence""" muscles = list(Worm().muscles()) evcheck = [] knowns = dict() for n in muscles: pp = [x.statements for x in (n.receptors, n.innervatedBy)] for stmt in itertools.chain(*pp): if stmt.context.identifier in knowns: n = self.get_supporting_evidence(stmt) knowns[stmt.context.identifier] = n evcheck.append(n) self.assertTrue(0 not in evcheck, "There appears to be no evidence: " + str(evcheck))
def test_get_semantic_net(self): g0 = Worm().get_semantic_net() self.assertTrue(isinstance(g0, R.ConjunctiveGraph))
def test_get_network(self): w = Worm() w.neuron_network(Network()) w.save() self.assertIsInstance(Worm().get_neuron_network(), Network)