Ejemplo n.º 1
0
def test1():
    datadir = resource_filename('sknano', 'data')
    dirnames, fnames = listdir(datadir)
    assert_true('__init__.py' in fnames)
    assert_true('fullerenes' in dirnames)
    assert_equal(dirnames, listdir_dirnames(datadir))
    assert_equal(fnames, listdir_fnames(datadir))
Ejemplo n.º 2
0
def test1():
    datadir = resource_filename('sknano', 'data')
    dirnames, fnames = listdir(datadir)
    assert_true('__init__.py' in fnames)
    assert_true('fullerenes' in dirnames)
    assert_equal(dirnames, listdir_dirnames(datadir))
    assert_equal(fnames, listdir_fnames(datadir))
Ejemplo n.º 3
0
def test2():
    datadir = resource_filename('sknano', 'data')
    filterfunc = lambda name: '_' not in name
    dirnames, fnames = listdir(datadir, filterfunc=filterfunc,
                               filter_fnames=True, filter_dirnames=True)
    assert_true('__pycache__' not in dirnames)
    assert_true('__init__.py' not in fnames)
    assert_equal(dirnames,
                 listdir_dirnames(datadir, filterfunc=filterfunc))
    assert_equal(fnames,
                 listdir_fnames(datadir, filterfunc=filterfunc))
Ejemplo n.º 4
0
def test2():
    datadir = resource_filename('sknano', 'data')
    filterfunc = lambda name: '_' not in name
    dirnames, fnames = listdir(datadir,
                               filterfunc=filterfunc,
                               filter_fnames=True,
                               filter_dirnames=True)
    assert_true('__pycache__' not in dirnames)
    assert_true('__init__.py' not in fnames)
    assert_equal(dirnames, listdir_dirnames(datadir, filterfunc=filterfunc))
    assert_equal(fnames, listdir_fnames(datadir, filterfunc=filterfunc))