Added 'listed' support for non-AMO validator use.

This commit is contained in:
Matt Basta 2011-04-26 04:32:43 +00:00
Родитель 463f8152a2
Коммит b8b69e75a0
2 изменённых файлов: 9 добавлений и 5 удалений

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

@ -10,13 +10,14 @@ from helper import _do_test
targetapp.APPROVED_APPLICATIONS = \
json.load(open("validator/app_versions.json"))
def _do_test_raw(rdf):
err = ErrorBundle()
def _do_test_raw(rdf, listed=True):
err = ErrorBundle(listed=listed)
rdf = RDFParser(StringIO(rdf.strip()))
err.save_resource("has_install_rdf", True)
err.save_resource("install_rdf", rdf)
targetapp.test_targetedapplications(err)
print err.print_summary()
return err
def test_valid_targetapps():
@ -133,7 +134,7 @@ def test_no_supported_mozilla_apps():
</RDF>
""").failed()
assert _do_test_raw("""
failure_case = """
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
@ -154,5 +155,8 @@ def test_no_supported_mozilla_apps():
</em:targetApplication>
</Description>
</RDF>
""").failed()
"""
assert _do_test_raw(failure_case).failed()
assert not _do_test_raw(failure_case, listed=False).failed()

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

@ -160,7 +160,7 @@ def test_targetedapplications(err, package_contents=None,
err.save_resource("supports", supports)
err.save_resource("supported_versions", all_supported_versions)
if not supports:
if not supports and err.get_resource("listed"):
err.error(
err_id=("testcases_targetapplication",
"test_targetedapplication",