Added launch_path to resource tests.

This commit is contained in:
Matt Basta 2012-09-12 10:56:59 -07:00
Родитель 6a94fdcc28
Коммит ecae218dfd
2 изменённых файлов: 16 добавлений и 0 удалений

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

@ -219,6 +219,11 @@ def test_app_resources(err, package):
test_icon(err, data=StringIO(icon_data), url=url, size=icon_size) test_icon(err, data=StringIO(icon_data), url=url, size=icon_size)
if "launch_path" in manifest:
try_get_resource(err, package, manifest["launch_path"],
filename="webapp.manifest", resource_type="origin",
max_size=False)
if "appcache_path" in manifest: if "appcache_path" in manifest:
try_get_resource(err, package, manifest["appcache_path"], try_get_resource(err, package, manifest["appcache_path"],
filename="webapp.manifest", resource_type="manifest", filename="webapp.manifest", resource_type="manifest",

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

@ -184,6 +184,17 @@ class TestResourcePolling(TestCase):
self.setup_manifest()["appcache_path"] = "fizz" self.setup_manifest()["appcache_path"] = "fizz"
appbase.test_app_resources(self.err, None) appbase.test_app_resources(self.err, None)
eq_(tgr.call_args[0][2], "fizz") eq_(tgr.call_args[0][2], "fizz")
# Test that we don't warn the dev that their appcache exceeds a size
# limit.
eq_(tgr.call_args[1]["max_size"], False)
@patch("appvalidator.testcases.webappbase.try_get_resource")
def test_launch_path(self, tgr):
self.setup_manifest()["launch_path"] = "fizz"
appbase.test_app_resources(self.err, None)
eq_(tgr.call_args[0][2], "fizz")
# Test that we don't warn the dev that their origin exceeds a size
# limit.
eq_(tgr.call_args[1]["max_size"], False) eq_(tgr.call_args[1]["max_size"], False)
@patch("appvalidator.testcases.webappbase.try_get_resource") @patch("appvalidator.testcases.webappbase.try_get_resource")