Example #1
0
File: url.py Project: LLNL/spack
def test_name_parsed_correctly():
    # Expected True
    assert name_parsed_correctly(MyPackage('netcdf',         []), 'netcdf')
    assert name_parsed_correctly(MyPackage('r-devtools',     []), 'devtools')
    assert name_parsed_correctly(MyPackage('py-numpy',       []), 'numpy')
    assert name_parsed_correctly(MyPackage('octave-splines', []), 'splines')
    assert name_parsed_correctly(MyPackage('th-data',        []), 'TH.data')
    assert name_parsed_correctly(
        MyPackage('imagemagick',    []), 'ImageMagick')

    # Expected False
    assert not name_parsed_correctly(MyPackage('',            []), 'hdf5')
    assert not name_parsed_correctly(MyPackage('hdf5',        []), '')
    assert not name_parsed_correctly(MyPackage('yaml-cpp',    []), 'yamlcpp')
    assert not name_parsed_correctly(MyPackage('yamlcpp',     []), 'yaml-cpp')
    assert not name_parsed_correctly(MyPackage('r-py-parser', []), 'parser')
    assert not name_parsed_correctly(
        MyPackage('oce',         []), 'oce-0.18.0')
Example #2
0
def test_name_parsed_correctly():
    # Expected True
    assert name_parsed_correctly(MyPackage('netcdf', []), 'netcdf')
    assert name_parsed_correctly(MyPackage('r-devtools', []), 'devtools')
    assert name_parsed_correctly(MyPackage('py-numpy', []), 'numpy')
    assert name_parsed_correctly(MyPackage('octave-splines', []), 'splines')
    assert name_parsed_correctly(MyPackage('th-data', []), 'TH.data')
    assert name_parsed_correctly(MyPackage('imagemagick', []), 'ImageMagick')

    # Expected False
    assert not name_parsed_correctly(MyPackage('', []), 'hdf5')
    assert not name_parsed_correctly(MyPackage('hdf5', []), '')
    assert not name_parsed_correctly(MyPackage('yaml-cpp', []), 'yamlcpp')
    assert not name_parsed_correctly(MyPackage('yamlcpp', []), 'yaml-cpp')
    assert not name_parsed_correctly(MyPackage('r-py-parser', []), 'parser')
    assert not name_parsed_correctly(MyPackage('oce', []), 'oce-0.18.0')