def test_appcache_path(self, tgr):
     self.setup_manifest()["appcache_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 appcache exceeds a size
     # limit.
     eq_(tgr.call_args[1]["max_size"], False)
Exemplo n.º 2
0
 def test_root_developer_present(self, tgr):
     self.setup_manifest()["developer"] = {"url": "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 homepage exceeds a size
     # limit.
     eq_(tgr.call_args[1]["max_size"], False)
Exemplo n.º 3
0
    def test_icons(self, tgr, test_icon):
        tgr.return_value = "foobar"

        self.setup_manifest()["icons"] = {"32": "fizz"}
        appbase.test_app_resources(self.err, None)
        eq_(tgr.call_args[0][2], "fizz")
        eq_(test_icon.call_args[1]["data"].getvalue(), "foobar")
Exemplo n.º 4
0
 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)
 def test_root_developer_present(self, tgr):
     self.setup_manifest()["developer"] = {"url": "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 homepage exceeds a size
     # limit.
     eq_(tgr.call_args[1]["max_size"], False)
    def test_icons(self, tgr, test_icon):
        tgr.return_value = "foobar"

        self.setup_manifest()["icons"] = {"32": "fizz"}
        appbase.test_app_resources(self.err, None)
        eq_(tgr.call_args[0][2], "fizz")
        eq_(test_icon.call_args[1]["data"].getvalue(), "foobar")
 def test_launch_path(self, tgr):
     tgr.return_value = False
     self.setup_manifest()["launch_path"] = "fizz"
     self.err.save_resource('packaged', False)
     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)
 def test_launch_path_no_appcache(self, tgr):
     tgr.return_value = """
     <html haldo="trogdor"></html>
     """
     self.setup_manifest()["launch_path"] = "fizz"
     self.err.save_resource('packaged', False)
     appbase.test_app_resources(self.err, None)
     eq_(tgr.call_args[0][2], "fizz")
     assert not self.err.failed()
 def test_launch_path_appcache(self, tgr):
     tgr.return_value = """
     <html manifest="hello"></html>
     """
     self.setup_manifest()["launch_path"] = "fizz"
     self.err.save_resource('packaged', False)
     appbase.test_app_resources(self.err, None)
     eq_(tgr.call_args[0][2], "fizz")
     assert self.err.failed(fail_on_warnings=True)
Exemplo n.º 10
0
 def test_launch_path_appcache(self, tgr):
     tgr.return_value = """
     <html manifest="hello"></html>
     """
     self.setup_manifest()["launch_path"] = "fizz"
     self.err.save_resource('packaged', False)
     appbase.test_app_resources(self.err, None)
     eq_(tgr.call_args[0][2], "fizz")
     assert self.err.failed(fail_on_warnings=True)
Exemplo n.º 11
0
 def test_launch_path_no_appcache(self, tgr):
     tgr.return_value = """
     <html haldo="trogdor"></html>
     """
     self.setup_manifest()["launch_path"] = "fizz"
     self.err.save_resource('packaged', False)
     appbase.test_app_resources(self.err, None)
     eq_(tgr.call_args[0][2], "fizz")
     assert not self.err.failed()
    def test_icons(self, tgr, test_icon):
        tgr.return_value = "foobar"

        self.setup_manifest()["icons"] = {"32": "fizz"}
        appbase.test_app_resources(self.err, None)
        eq_(tgr.call_args[0][2], "fizz")

        # Icons must be fetched with "binary" keyword argument.
        eq_(tgr.call_args[1]['binary'], True)
        eq_(test_icon.call_args[1]["data"].getvalue(), "foobar")
    def test_icons(self, tgr, test_icon):
        tgr.return_value = "foobar"

        self.setup_manifest()["icons"] = {"32": "fizz"}
        appbase.test_app_resources(self.err, None)
        eq_(tgr.call_args[0][2], "fizz")

        # Icons must be fetched with "binary" keyword argument.
        eq_(tgr.call_args[1]['binary'], True)
        eq_(test_icon.call_args[1]["data"].getvalue(), "foobar")
 def test_locale_developer_url_absent(self, tgr):
     self.setup_manifest()["locales"] = {"es": {"developer": {}}}
     appbase.test_app_resources(self.err, None)
     assert not tgr.called
Exemplo n.º 15
0
 def test_ignore_when_errors(self):
     """When there are errors in validation, don't poll the resources."""
     err = Mock()
     err.errors = True
     appbase.test_app_resources(err, None)
     eq_(err.get_resource.call_count, 0)
 def test_root_developer_absent(self, tgr):
     self.setup_manifest()["developer"] = {}
     appbase.test_app_resources(self.err, None)
     assert not tgr.called
Exemplo n.º 17
0
 def test_ignore_when_missing_manifest(self):
     """When there are errors in validation, don't poll the resources."""
     self.setup_err()
     appbase.test_app_resources(self.err, None)
     self.assert_silent()
Exemplo n.º 18
0
 def test_too_many_icons(self):
     self.setup_manifest()["icons"] = dict([(str(i), "http://foo%d.jpg" % i)
                                            for i in range(ICON_LIMIT + 1)])
     appbase.test_app_resources(self.err, None)
     self.assert_failed(with_warnings=True)
Exemplo n.º 19
0
 def test_many_icons_same_url(self):
     self.setup_manifest()["icons"] = dict([(str(i), "foo.jpg")
                                            for i in range(ICON_LIMIT + 1)])
     appbase.test_app_resources(self.err, None)
     self.assert_silent()
Exemplo n.º 20
0
 def test_root_developer_absent(self, tgr):
     self.setup_manifest()["developer"] = {}
     appbase.test_app_resources(self.err, None)
     assert not tgr.called
 def test_many_icons_same_url(self):
     self.setup_manifest()["icons"] = dict(
         [(str(i), "foo.jpg") for i in range(ICON_LIMIT + 1)])
     appbase.test_app_resources(self.err, None)
     self.assert_silent()
 def test_too_many_icons(self):
     self.setup_manifest()["icons"] = dict(
         [(str(i), "http://foo%d.jpg" % i) for i in range(ICON_LIMIT + 1)])
     appbase.test_app_resources(self.err, None)
     self.assert_failed(with_warnings=True)
 def test_ignore_when_missing_manifest(self):
     """When there are errors in validation, don't poll the resources."""
     self.setup_err()
     appbase.test_app_resources(self.err, None)
     self.assert_silent()
 def test_ignore_when_errors(self):
     """When there are errors in validation, don't poll the resources."""
     err = Mock()
     err.errors = True
     appbase.test_app_resources(err, None)
     eq_(err.get_resource.call_count, 0)
Exemplo n.º 25
0
 def test_locale_developer_url_absent(self, tgr):
     self.setup_manifest()["locales"] = {"es": {"developer": {}}}
     appbase.test_app_resources(self.err, None)
     assert not tgr.called