Beispiel #1
0
def test_eq():
    other = ezy.load_neuron(MORPH_FILE)
    nt.assert_true(ezy_utils.neurons_eq(NEURON, other))
Beispiel #2
0
'''Test neurom.ezy.utils'''

import os
from copy import deepcopy
from neurom.point_neurite import ezy
from neurom.point_neurite.ezy import utils as ezy_utils
from collections import namedtuple
from neurom.core.types import NeuriteType
from nose import tools as nt


_path = os.path.dirname(os.path.abspath(__file__))
DATA_PATH = os.path.join(_path, '../../../../test_data')
MORPH_FILE = os.path.join(DATA_PATH, 'swc', 'Neuron.swc')
NEURON = ezy.load_neuron(MORPH_FILE)


def test_eq():
    other = ezy.load_neuron(MORPH_FILE)
    nt.assert_true(ezy_utils.neurons_eq(NEURON, other))


def test_compare_neurites():

    fake_neuron = namedtuple('Neuron', 'neurites')
    fake_neuron.neurites = []
    nt.assert_false(ezy_utils._compare_neurites(NEURON, fake_neuron, NeuriteType.axon))
    nt.assert_true(fake_neuron, fake_neuron)

    neuron2 = deepcopy(NEURON)