tests: fmt: add test for #263

This commit is contained in:
William Ballenthin
2020-08-31 16:34:10 -06:00
parent 2bd0c03f70
commit 0734edf6f0

View File

@@ -92,6 +92,8 @@ def test_rule_reformat_order():
def test_rule_reformat_meta_update():
# test updating the rule content after parsing
rule = textwrap.dedent(
"""
rule:
@@ -112,3 +114,23 @@ def test_rule_reformat_meta_update():
rule = capa.rules.Rule.from_yaml(rule)
rule.name = "test rule"
assert rule.to_yaml() == EXPECTED
def test_rule_reformat_string_description():
# see #263
src = textwrap.dedent(
"""
rule:
meta:
name: test rule
author: user@domain.com
scope: function
features:
- and:
- string: foo
description: bar
"""
)
rule = capa.rules.Rule.from_yaml(src)
assert rule.to_yaml() == src