Esempio n. 1
0
def test_parse_context_repeated_key():
    from lawyerup.core import parse_context
    from test.utils import Error

    vars = ["key1=val1", "key1=duplicate"]
    with pytest.raises(Error) as e:
        out = parse_context(vars)
        assert e.message == '"key1" specified multiple times!'
        assert out is None
Esempio n. 2
0
def test_parse_context_repeated_key():
    from lawyerup.core import parse_context
    from test.utils import Error

    vars = ['key1=val1', 'key1=duplicate']
    with pytest.raises(Error) as e:
        out = parse_context(vars)
        assert e.message == '"key1" specified multiple times!'
        assert out is None
Esempio n. 3
0
def test_parse_context():
    from lawyerup.core import parse_context

    vars = ["key1=val1", "key2=val2"]
    expected = {"key1": "val1", "key2": "val2"}
    assert parse_context(vars) == expected
Esempio n. 4
0
def test_parse_context():
    from lawyerup.core import parse_context

    vars = ['key1=val1', 'key2=val2']
    expected = {'key1': 'val1', 'key2': 'val2'}
    assert parse_context(vars) == expected