Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't assume app name is string.

  • Loading branch information...
commit 6a476dc63cfb1f1f1eb84af1e0c729da3ad87c52 1 parent bb197d0
Matt Basta mattbasta authored
Showing with 8 additions and 1 deletion.
  1. +2 −1  appvalidator/webapp.py
  2. +6 −0 tests/test_webapp.py
3  appvalidator/webapp.py
View
@@ -35,7 +35,8 @@ def detect_webapp_string(err, data):
# This magic number brought to you by @cvan (see bug 770755)
# Updated 11/21/12: Bumped to 12 because Gaia is different.
- if "name" in webapp and len(webapp["name"]) > 12:
+ if ("name" in webapp and isinstance(webapp["name"], (str, unicode)) and
+ len(webapp["name"]) > 12):
err.warning(
err_id=("webapp", "b2g", "name_truncated"),
warning="App name may be truncated on Firefox OS devices.",
6 tests/test_webapp.py
View
@@ -155,6 +155,12 @@ def test_long_name(self):
self.analyze()
self.assert_failed(with_warnings=True)
+ def test_long_name(self):
+ """Test that long names are flagged for truncation in Gaia."""
+ self.data["name"] = None
+ self.analyze()
+ self.assert_failed(with_errors=True)
+
def test_maxlengths(self):
"""Test that certain elements are capped in length."""
self.data["name"] = "%" * 129
Please sign in to comment.
Something went wrong with that request. Please try again.