def test_parse_invalid(raw): with pytest.raises(ValueError, match='invalid macro string'): macros.parse_macro(raw)
def test_parse_excessive_whitespace(): op, args = macros.parse_macro('[:op foo=asd bar=asdz]') assert op == 'op' assert args == {'foo': 'asd', 'bar': 'asdz'}
def test_parse_op_with_arg(): op, args = macros.parse_macro('[:op foo=asd]') assert op == 'op' assert args == {'foo': 'asd'}
def test_parse_op_with_args(): op, args = macros.parse_macro('[:op foo=asd bar=asdz]') assert op == 'op' assert args == {'foo': 'asd', 'bar': 'asdz'}
def test_parse_op_only(): op, args = macros.parse_macro('[:op]') assert op == 'op' assert args == {}