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

Unified Diff: gm/rebaseline_server/results_test.py

Issue 848073005: Revert "delete old things!" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
« no previous file with comments | « gm/rebaseline_server/results.py ('k') | gm/rebaseline_server/rs_fixpypath.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rebaseline_server/results_test.py
diff --git a/gm/rebaseline_server/results_test.py b/gm/rebaseline_server/results_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..f22e833fe3a24f452fc9615d3e68ce559b6df341
--- /dev/null
+++ b/gm/rebaseline_server/results_test.py
@@ -0,0 +1,81 @@
+#!/usr/bin/python
+
+"""
+Copyright 2014 Google Inc.
+
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+
+Test results.py
+
+"""
+
+# Imports from within Skia
+import base_unittest
+import results
+
+
+class ResultsTest(base_unittest.TestCase):
+
+ def test_ignore_builder(self):
+ """Test _ignore_builder()."""
+ results_obj = results.BaseComparisons()
+ self.assertEqual(results_obj._ignore_builder('SomethingTSAN'), True)
+ self.assertEqual(results_obj._ignore_builder('Something-Trybot'), True)
+ self.assertEqual(results_obj._ignore_builder(
+ 'Test-Ubuntu12-ShuttleA-GTX660-x86-Release'), False)
+ results_obj.set_skip_builders_pattern_list(['.*TSAN.*', '.*GTX660.*'])
+ self.assertEqual(results_obj._ignore_builder('SomethingTSAN'), True)
+ self.assertEqual(results_obj._ignore_builder('Something-Trybot'), False)
+ self.assertEqual(results_obj._ignore_builder(
+ 'Test-Ubuntu12-ShuttleA-GTX660-x86-Release'), True)
+ results_obj.set_skip_builders_pattern_list(None)
+ self.assertEqual(results_obj._ignore_builder('SomethingTSAN'), False)
+ self.assertEqual(results_obj._ignore_builder('Something-Trybot'), False)
+ self.assertEqual(results_obj._ignore_builder(
+ 'Test-Ubuntu12-ShuttleA-GTX660-x86-Release'), False)
+ results_obj.set_match_builders_pattern_list(['.*TSAN'])
+ self.assertEqual(results_obj._ignore_builder('SomethingTSAN'), False)
+ self.assertEqual(results_obj._ignore_builder('Something-Trybot'), True)
+ self.assertEqual(results_obj._ignore_builder(
+ 'Test-Ubuntu12-ShuttleA-GTX660-x86-Release'), True)
+
+ def test_combine_subdicts_typical(self):
+ """Test combine_subdicts() with no merge conflicts. """
+ input_dict = {
+ "failed" : {
+ "changed.png" : [ "bitmap-64bitMD5", 8891695120562235492 ],
+ },
+ "no-comparison" : {
+ "unchanged.png" : [ "bitmap-64bitMD5", 11092453015575919668 ],
+ }
+ }
+ expected_output_dict = {
+ "changed.png" : [ "bitmap-64bitMD5", 8891695120562235492 ],
+ "unchanged.png" : [ "bitmap-64bitMD5", 11092453015575919668 ],
+ }
+ actual_output_dict = results.BaseComparisons.combine_subdicts(
+ input_dict=input_dict)
+ self.assertEqual(actual_output_dict, expected_output_dict)
+
+ def test_combine_subdicts_with_merge_conflict(self):
+ """Test combine_subdicts() with a merge conflict. """
+ input_dict = {
+ "failed" : {
+ "changed.png" : [ "bitmap-64bitMD5", 8891695120562235492 ],
+ },
+ "no-comparison" : {
+ "changed.png" : [ "bitmap-64bitMD5", 11092453015575919668 ],
+ }
+ }
+ with self.assertRaises(Exception):
+ actual_output_dict = results.BaseComparisons.combine_subdicts(
+ input_dict=input_dict)
+
+
+def main():
+ base_unittest.main(ResultsTest)
+
+
+if __name__ == '__main__':
+ main()
« no previous file with comments | « gm/rebaseline_server/results.py ('k') | gm/rebaseline_server/rs_fixpypath.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698