Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add cordova flag to validator output (bug 926560)

  • Loading branch information...
commit 210f99c2228fa33505f37828e9484eb0cb4dccbe 1 parent cc029e0
@mattbasta authored
Showing with 29 additions and 0 deletions.
  1. +9 −0 appvalidator/testcases/content.py
  2. +20 −0 tests/test_content.py
View
9 appvalidator/testcases/content.py
@@ -119,3 +119,12 @@ def _process_file(err, package, name, file_data):
p.process(name, file_data, package.info(name)["extension"])
return True
+
+
+@register_test(tier=2)
+def test_cordova(err, package=None):
+
+ if not package:
+ return
+
+ err.metadata["cordova"] = "www/cordova.js" in package
View
20 tests/test_content.py
@@ -161,3 +161,23 @@ def test_too_much_garbage(self):
content.test_packed_packages(self.err, mock_package)
self.assert_failed(with_warnings=True, with_errors=True)
+
+
+class TestContent(TestCase):
+
+ def _run_test(self, mock_package):
+ return content.test_packed_packages(self.err, mock_package)
+
+ def test_cordova_fail(self):
+ "Test that cordova is detected in the content tests."
+ self.setup_err()
+ mock_package = MockXPI({"foo.bar": "tests/resources/content/junk.xpi"})
+
+ content.test_cordova(self.err, mock_package)
+ assert not self.err.metadata["cordova"]
+
+ # We can recycle the error bundle since it's clean.
+ mock_package = MockXPI({"www/cordova.js": "tests/resources/content/junk.xpi"})
+
+ content.test_cordova(self.err, mock_package)
+ assert self.err.metadata["cordova"]
Please sign in to comment.
Something went wrong with that request. Please try again.