add more tests to verify the behavior of the metadata parser

This commit is contained in:
Kevin Dangoor 2009-12-17 12:44:48 -05:00
Родитель 6adc3f64d4
Коммит 532e6cb6a4
1 изменённых файлов: 17 добавлений и 2 удалений

Просмотреть файл

@ -73,7 +73,22 @@ def test_plugin_metadata_parsing():
More code here...
""", dict(foo="bar")]
""", dict(foo="bar")],
["""
'define metadata' ;
({"bar":
"baz"}
);
"end";
""", dict(bar="baz")],
["""
""", None],
["""
"define metadata";
({});
// there is no end
""", None]
]
def run_one(input, expected):
@ -87,7 +102,7 @@ More code here...
assert parsed == expected
for test in tests:
run_one(*test)
yield run_one, test[0], test[1]
def test_plugin_metadata():
plugin_list = list(plugins.find_plugins())