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

Side by Side Diff: appengine/findit/crash/test/stacktrace_test_suite.py

Issue 2562623004: Making CallStack immutable, so it can be hashable (Closed)
Patch Set: Addressing nits Created 4 years 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 unified diff | Download patch
« no previous file with comments | « appengine/findit/crash/test/stacktrace_test.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from testing_utils import testing 5 from testing_utils import testing
6 6
7 from crash.test.crash_testcase import CrashTestCase 7 from crash.test.crash_testcase import CrashTestCase
8 8
9 9
10 class StacktraceTestSuite(CrashTestCase): #pragma: no cover. 10 class StacktraceTestSuite(CrashTestCase): #pragma: no cover.
11 11
12 def _VerifyTwoStackFramesEqual(self, frame1, frame2): 12 def _VerifyTwoStackFramesEqual(self, frame1, frame2):
13 self.assertIsNotNone(frame1, "the first frame is unexpectedly missing")
14 self.assertIsNotNone(frame2, "the second frame is unexpectedly missing")
13 self.assertEqual(str(frame1), str(frame2)) 15 self.assertEqual(str(frame1), str(frame2))
14 self.assertEqual(frame1.dep_path, frame2.dep_path) 16 self.assertEqual(frame1.dep_path, frame2.dep_path)
15 17
16 def _VerifyTwoCallStacksEqual(self, stack1, stack2): 18 def _VerifyTwoCallStacksEqual(self, stack1, stack2):
17 self.assertEqual(len(stack1), len(stack2)) 19 self.assertIsNotNone(stack1, "the first stack is unexpectedly missing")
20 self.assertIsNotNone(stack2, "the second stack is unexpectedly missing")
21 self.assertEqual(len(stack1.frames), len(stack2.frames))
18 self.assertEqual(stack1.priority, stack2.priority) 22 self.assertEqual(stack1.priority, stack2.priority)
19 self.assertEqual(stack1.format_type, stack2.format_type) 23 self.assertEqual(stack1.format_type, stack2.format_type)
20 self.assertEqual(stack1.language_type, stack2.language_type) 24 self.assertEqual(stack1.language_type, stack2.language_type)
21 map(self._VerifyTwoStackFramesEqual, stack1, stack2) 25 map(self._VerifyTwoStackFramesEqual, stack1.frames, stack2.frames)
22 26
23 def _VerifyTwoStacktracesEqual(self, stacktrace1, stacktrace2): 27 def _VerifyTwoStacktracesEqual(self, trace1, trace2):
24 self.assertEqual(len(stacktrace1), len(stacktrace2)) 28 self.assertIsNotNone(trace1, "the first trace is unexpectedly missing")
25 map(self._VerifyTwoCallStacksEqual, stacktrace1, stacktrace2) 29 self.assertIsNotNone(trace2, "the second trace is unexpectedly missing")
30 self.assertEqual(len(trace1.stacks), len(trace2.stacks))
31 map(self._VerifyTwoCallStacksEqual, trace1.stacks, trace2.stacks)
OLDNEW
« no previous file with comments | « appengine/findit/crash/test/stacktrace_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698