示例#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
示例#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
示例#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
示例#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
示例#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
示例#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