Ejemplo n.º 1
0
def test_not_valid_raml_obj():
    invalid_obj = 1234
    with pytest.raises(LoadRAMLError) as e:
        _get_raml_object(invalid_obj)
    msg = (("Can not load object '{0}': Not a basestring type or "
            "file object".format(invalid_obj)), )
    assert e.value.args == msg
Ejemplo n.º 2
0
def test_not_valid_raml_obj():
    invalid_obj = 1234
    with pytest.raises(LoadRAMLError) as e:
        _get_raml_object(invalid_obj)
    msg = (("Can not load object '{0}': Not a basestring type or "
           "file object".format(invalid_obj)),)
    assert e.value.args == msg
Ejemplo n.º 3
0
def test_raml_file_object(raml_file):
    with open(raml_file) as f:
        raml_obj = _get_raml_object(f)
        assert raml_obj == f
Ejemplo n.º 4
0
def test_raml_file_is_none():
    raml_file = None
    with pytest.raises(LoadRAMLError) as e:
        _get_raml_object(raml_file)
    msg = ("RAML file can not be 'None'.", )
    assert e.value.args == msg
Ejemplo n.º 5
0
def test_raml_file_object(raml_file):
    with open(raml_file) as f:
        raml_obj = _get_raml_object(f)
        assert raml_obj == f
Ejemplo n.º 6
0
def test_raml_file_is_none():
    raml_file = None
    with pytest.raises(LoadRAMLError) as e:
        _get_raml_object(raml_file)
    msg = ("RAML file can not be 'None'.",)
    assert e.value.args == msg