<s> from __future__ import print_function <EOL> import sys <EOL> sys . path . insert ( <NUM_LIT:0> , "<STR_LIT:.>" ) <EOL> import unittest <EOL> import neuroml <EOL> import neuroml . writers as writers <EOL> import PyOpenWorm <EOL> from PyOpenWorm import * <EOL> import networkx <EOL> import rdflib <EOL> import rdflib as R <EOL> import pint as Q <EOL> import os <EOL> import subprocess as SP <EOL> import subprocess <EOL> import tempfile <EOL> import doctest <EOL> from glob import glob <EOL> from GraphDBInit import * <EOL> from DataTestTemplate import _DataTest <EOL> class NeuronTest ( _DataTest ) : <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> import logging <EOL> def setUp ( self ) : <EOL> _DataTest . setUp ( self ) <EOL> self . neur = lambda x : Neuron ( name = x ) <EOL> def test_Cell ( self ) : <EOL> do = self . neur ( '<STR_LIT>' ) <EOL> self . assertTrue ( isinstance ( do , Cell ) ) <EOL> def test_receptors ( self ) : <EOL> n = self . neur ( '<STR_LIT>' ) <EOL> n . receptor ( '<STR_LIT>' ) <EOL> n . save ( ) <EOL> self . assertIn ( '<STR_LIT>' , list ( self . neur ( '<STR_LIT>' ) . receptors ( ) ) ) <EOL> def test_same_name_same_id ( self ) : <EOL> """<STR_LIT>""" <EOL> c = Neuron ( name = "<STR_LIT>" ) <EOL> c1 = Neuron ( name = "<STR_LIT>" ) <EOL> self . assertEqual ( c . identifier ( ) , c1 . identifier ( ) ) <EOL> def test_type ( self ) : <EOL> n = self . neur ( '<STR_LIT>' ) <EOL> n . type ( '<STR_LIT>' ) <EOL> n . save ( ) <EOL> self . assertEqual ( '<STR_LIT>' , self . neur ( '<STR_LIT>' ) . type . one ( ) ) <EOL> def test_name ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( '<STR_LIT>' , self . neur ( '<STR_LIT>' ) . name ( ) ) <EOL> self . assertEqual ( '<STR_LIT>' , self . neur ( '<STR_LIT>' ) . name ( ) ) <EOL> def test_neighbor ( self ) : <EOL> n = self . neur ( '<STR_LIT>' ) <EOL> n . neighbor ( self . neur ( '<STR_LIT>' ) , syntype = '<STR_LIT>' ) <EOL> neighbors = list ( n . neighbor ( ) ) <EOL> self . assertIn ( self . neur ( '<STR_LIT>' ) , neighbors ) <EOL> g = R . Graph ( ) <EOL> for t in n . triples ( ) : <EOL> g . add ( t ) <EOL> n . save ( ) <EOL> self . assertIn ( self . neur ( '<STR_LIT>' ) , list ( self . neur ( '<STR_LIT>' ) . neighbor ( ) ) ) <EOL> def test_init_from_lineage_name ( self ) : <EOL> c = Neuron ( lineageName = "<STR_LIT>" , name = "<STR_LIT>" ) <EOL> c . save ( ) <EOL> c = Neuron ( lineageName = "<STR_LIT>" ) <EOL> self . assertEqual ( c . name ( ) , '<STR_LIT>' ) </s>
