Skip to content
Browse files

Fix Jetpack module presence tests.

  • Loading branch information...
1 parent 0a06b37 commit 0c1c581dfb0dfa4f18de21c18abf1b669265b544 @kmaglione kmaglione committed Jun 4, 2013
View
BIN tests/resources/jetpack/jetpack-1.14.xpi
Binary file not shown.
View
13 tests/test_jetpack.py
@@ -313,6 +313,19 @@ def test_mismatched_module_version():
assert any(w["id"][2] == "mismatched_version" for w in err.warnings)
+def test_new_module_location_spec():
+ """
+ Tests that we don't fail for missing modules in add-ons generated with
+ newer versions of the SDK.
+ """
+
+ xpi = XPIManager("tests/resources/jetpack/jetpack-1.14.xpi")
+ err = _do_test(xpi)
+
+ assert not any(w["id"][2] == "missing_jetpack_module"
+ for w in err.warnings)
+
+
def test_components_flagged():
"""Test that `Components` is flagged in Jetpack."""
View
6 validator/testcases/jetpack.py
@@ -174,6 +174,12 @@ def inspect_jetpack(err, xpi_package, allow_old_sdk=False):
uri = uri[11:]
zip_path = "resources/%s" % uri.replace("@", "-at-")
+ # The key is no longer a URI in newer versions of the SDK
+ if zip_path not in xpi_package:
+ zip_path = 'resources/%s/%s/%s.js' % (
+ module['packageName'], module['sectionName'],
+ module['moduleName'])
+
# Check the zipname element if it exists.
if zip_path not in xpi_package:
err.warning(

0 comments on commit 0c1c581

Please sign in to comment.
Something went wrong with that request. Please try again.