Skip to content
This repository
Browse code

Removed junk Java test from amo-validator

  • Loading branch information...
commit 94b4cfd771d977afb81566cacc89b2c7c05ad9ec 1 parent a043094
Matt Basta authored December 10, 2012
44  appvalidator/testcases/packagelayout.py
@@ -17,10 +17,6 @@
17 17
         (0x43, 0x57, 0x53),  # ZLIB compressed SWF
18 18
 )
19 19
 
20  
-# If there are more than 10 .class files in a package, it is flagged as a Java
21  
-# archive file.
22  
-JAVA_JAR_THRESHOLD = 10
23  
-
24 20
 
25 21
 @register_test(tier=1)
26 22
 def test_blacklisted_files(err, package=None):
@@ -72,32 +68,20 @@ def test_blacklisted_files(err, package=None):
72 68
 
73 69
     if flagged_files:
74 70
         # Detect Java JAR files:
75  
-        if (sum(1 for f in flagged_files if f.endswith(".class")) >
76  
-                JAVA_JAR_THRESHOLD):
77  
-            err.notice(
78  
-                err_id=("testcases_packagelayout",
79  
-                        "test_blacklisted_files",
80  
-                        "java_jar"),
81  
-                notice="Java JAR file detected.",
82  
-                description="A Java JAR file was detected in the add-on.",
83  
-                filename=package.filename)
84  
-        else:
85  
-            err.warning(
86  
-                err_id=("testcases_packagelayout",
87  
-                        "test_blacklisted_files",
88  
-                        "disallowed_extension"),
89  
-                warning="Flagged file extensions found.",
90  
-                description=["Files whose names end with flagged extensions "
91  
-                             "have been found in the add-on.",
92  
-                             "The extension of these files are flagged because "
93  
-                             "they usually identify binary components. Please "
94  
-                             "see "
95  
-                             "http://addons.mozilla.org/developers/docs/"
96  
-                                 "policies/reviews#section-binary"
97  
-                             " for more information on the binary content "
98  
-                             "review process.",
99  
-                             "\n".join(flagged_files)],
100  
-                filename=name)
  71
+        err.warning(
  72
+            err_id=("testcases_packagelayout",
  73
+                    "test_blacklisted_files",
  74
+                    "disallowed_extension"),
  75
+            warning="Flagged file extensions found.",
  76
+            description=["Files whose names end with flagged extensions have "
  77
+                         "been found in the add-on.",
  78
+                         "The extension of these files are flagged because "
  79
+                         "they usually identify binary components. Please see "
  80
+                         "http://addons.mozilla.org/developers/docs/"
  81
+                             "policies/reviews#section-binary"
  82
+                         " for more information on the binary content review "
  83
+                         "process.", "\n".join(flagged_files)],
  84
+            filename=name)
101 85
 
102 86
 
103 87
 @register_test(tier=1)
15  tests/test_packagelayout.py
@@ -18,21 +18,6 @@ def test_blacklisted_files():
18 18
     assert err.metadata["contains_binary_extension"]
19 19
 
20 20
 
21  
-def test_java_jar_detection():
22  
-    """
23  
-    Test that Java archives are flagged as such so that they do not generate
24  
-    hundreds or thousands of errors.
25  
-    """
26  
-
27  
-    classes = ("c%d.class" % i for i in xrange(1000))
28  
-    mock_xpi = MockXPI(dict(zip(classes, repeat(""))))
29  
-    err = ErrorBundle()
30  
-    packagelayout.test_blacklisted_files(err, mock_xpi)
31  
-
32  
-    assert not err.failed()
33  
-    assert err.notices
34  
-
35  
-
36 21
 def test_blacklisted_magic_numbers():
37 22
     "Tests that blacklisted magic numbers are banned"
38 23
 

0 notes on commit 94b4cfd

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