diff --git a/tests/test_targetapplication.py b/tests/test_targetapplication.py index 6c4918d..88a9d76 100644 --- a/tests/test_targetapplication.py +++ b/tests/test_targetapplication.py @@ -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(): """).failed() - assert _do_test_raw(""" + failure_case = """ @@ -154,5 +155,8 @@ def test_no_supported_mozilla_apps(): - """).failed() + """ + + assert _do_test_raw(failure_case).failed() + assert not _do_test_raw(failure_case, listed=False).failed() diff --git a/validator/testcases/targetapplication.py b/validator/testcases/targetapplication.py index 219f0c9..68b6d93 100644 --- a/validator/testcases/targetapplication.py +++ b/validator/testcases/targetapplication.py @@ -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",