Example #1
0
def test_invalid_yaml_file():
    """Try to read an invalid YAML file"""
    filename = join(RESOURCE_FOLDER, "this_should_not_exist.yml")
    try:
        utilities.load_yaml_file(filename)
    except SystemExit as exc:
        assert isinstance(exc, SystemExit)
        return
    assert False
Example #2
0
def test_invalid_yaml_file():
    """Try to read an invalid YAML file"""
    filename = join(RESOURCE_FOLDER, "this_should_not_exist.yml")
    try:
        utilities.load_yaml_file(filename)
    except SystemExit as exc:
        assert isinstance(exc, SystemExit)
        return
    assert False
Example #3
0
def test_load_yaml_file():
    """Read a YAML file successfully"""
    filename = join(RESOURCE_FOLDER, "yaml_test.yml")
    expected = {
        "answer": 42,
        "hello": "world",
        "complex": {"truth": False, "key": "value"},
    }
    assert utilities.load_yaml_file(filename) == expected
Example #4
0
def test_load_yaml_file():
    """Read a YAML file successfully"""
    filename = join(RESOURCE_FOLDER, "yaml_test.yml")
    expected = {
        "answer": 42,
        "hello": "world",
        "complex": {"truth": False, "key": "value"},
    }
    assert utilities.load_yaml_file(filename) == expected