Esempio n. 1
0
def test_dict_to_yaml_invalid_object():
    params = {Parameters(): Parameters()}
    with pytest.raises(RepresenterError):
        ConfigParser.dict_to_yaml(
            d=params,
            yaml_file=FILE_OUT,
        )
Esempio n. 2
0
def test_dict_to_yaml_wrong_type_yaml_file():
    params = Parameters().to_dict()
    with pytest.raises(TypeError):
        ConfigParser.dict_to_yaml(
            d=params,
            yaml_file=LIST,
        )
Esempio n. 3
0
def test_dict_to_yaml_file_unavailable():
    params = Parameters().to_dict()
    ret = ConfigParser.dict_to_yaml(
        d=params,
        yaml_file=FILE_UNAVAILABLE,
    )
    assert ret is None
Esempio n. 4
0
def test_dict_to_yaml_file_ok():
    params = Parameters().to_dict()
    ret = ConfigParser.dict_to_yaml(
        d=params,
        yaml_file=FILE_OUT,
    )
    assert ret is None
Esempio n. 5
0
def test_dict_to_yaml_wrong_type_d():
    with pytest.raises(TypeError):
        ConfigParser.dict_to_yaml(
            d=LIST,
            yaml_file=FILE_OUT,
        )