Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1169)

Unified Diff: appengine/findit/crash/loglinear/test/feature_test.py

Issue 2617273002: [Predator] Move ``SingleFeatureScore`` to LLM. (Closed)
Patch Set: Address comment. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/findit/crash/loglinear/test/feature_test.py
diff --git a/appengine/findit/crash/loglinear/test/feature_test.py b/appengine/findit/crash/loglinear/test/feature_test.py
index 6c37bfaf34e4c5a5852eaf4a137252d0184757e8..75536e9e49c2273c63af664968e74f8749fb6b18 100644
--- a/appengine/findit/crash/loglinear/test/feature_test.py
+++ b/appengine/findit/crash/loglinear/test/feature_test.py
@@ -5,6 +5,7 @@
import unittest
from crash.loglinear import feature
+from crash.loglinear.test.loglinear_testcase import LoglinearTestCase
import libs.math.logarithms as lmath
_MAXIMUM = 50.
@@ -38,3 +39,13 @@ class ChangelistFeatureTest(unittest.TestCase):
def testLogLinearlyScaledIsOverMax(self):
"""Test that ``LogLinearlyScaled`` takes values over the max to log(0)."""
self.assertEqual(lmath.LOG_ZERO, feature.LogLinearlyScaled(42., 10.))
+
+
+class FeatureFunctionTest(LoglinearTestCase):
+
+ def testFeatureFunction(self):
+ """Test that ``FeatureFunction`` obeys the equality its docstring says."""
+ for x in self._X:
+ for y in self._Y(x):
+ for f in self._feature_list:
+ self.assertEqual(f(x)(y), self._feature_function(x)(y)[f.name])

Powered by Google App Engine
This is Rietveld 408576698