Esempio n. 1
0
def test_NeuronLoader():
    dirpath = Path(DATA_PATH, 'h5', 'v1')
    loader = utils.NeuronLoader(dirpath, file_ext='.h5', cache_size=5)
    nrn = loader.get('Neuron')
    nt.ok_(isinstance(nrn, Neuron))
    # check caching
    nt.ok_(nrn == loader.get('Neuron'))
    nt.ok_(nrn != loader.get('Neuron_2_branch'))
Esempio n. 2
0
def test_NeuronLoader_mixed_file_extensions():
    loader = utils.NeuronLoader(VALID_DATA_PATH)
    loader.get('Neuron')
    loader.get('Neuron_h5v1')
    nt.assert_raises(NeuroMError, loader.get, 'NoSuchNeuron')
Esempio n. 3
0
def test_NeuronLoader_mixed_file_extensions():
    dirpath = os.path.join(DATA_PATH, 'valid_set')
    loader = utils.NeuronLoader(dirpath)
    loader.get('Neuron')
    loader.get('Neuron_h5v1')
    nt.assert_raises(NeuroMError, loader.get, 'NoSuchNeuron')
Esempio n. 4
0
def test_NeuronLoader_mixed_file_extensions():
    loader = utils.NeuronLoader(VALID_DATA_PATH)
    loader.get('Neuron')
    loader.get('Neuron_h5v1')
    with pytest.raises(NeuroMError):
        loader.get('NoSuchNeuron')