Beispiel #1
0
def test_build_manifest_fail2():
    """Test recursive definition"""
    config_file = {
        'manifest': {
            '$BASE': '$TMP/share',
            '$TMP': '$BASE/share',
        }
    }
    with pytest.raises(Exception):
        cfg.__build_manifest(config_file)
Beispiel #2
0
def test_build_manifest_fail1():
    """Test exception occurs when variable is missing"""
    config_file = {
        'manifest': {
            '$BASE': '/base',
            '$TMP': '$VAR/Smat',
        }
    }
    with pytest.raises(Exception):
        cfg.__build_manifest(config_file)
Beispiel #3
0
def test_build_manifest2():
    config_file = {
        'manifest': {
            '$DIR_DATA': 'data',
            '$DIR_MAT': 'mat',
            '$APPS': '/${DIR_DATA}/$DIR_MAT/apps'
        }
    }

    manifest = cfg.__build_manifest(config_file)
    assert (manifest['$APPS'] == '/data/mat/apps')
Beispiel #4
0
def test_build_manifest1():
    """Test simple manifest"""
    config_file = {
        'manifest': {
            '$BASE_DIR': '/base',
            '$TMP_DIR': '$BASE_DIR/tmp',
            '$SHARE_DIR': '${TMP_DIR}_1/share'
        }
    }

    manifest = cfg.__build_manifest(config_file)
    assert (manifest['$BASE_DIR'] == '/base')
    assert (manifest['$TMP_DIR'] == '/base/tmp')
    assert (manifest['$SHARE_DIR'] == '/base/tmp_1/share')