OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Unit tests for breakpad.py.""" | 6 """Unit tests for breakpad.py.""" |
7 | 7 |
8 # pylint: disable=W0403 | 8 import os |
| 9 import sys |
9 | 10 |
10 # Fixes include path. | 11 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
| 12 |
11 from super_mox import SuperMoxTestBase | 13 from super_mox import SuperMoxTestBase |
12 | 14 |
13 import breakpad | 15 import breakpad |
14 | 16 |
15 | 17 |
16 class Breakpad(SuperMoxTestBase): | 18 class Breakpad(SuperMoxTestBase): |
17 """Setups and tear downs the mocks but doesn't test anything as-is.""" | 19 """Setups and tear downs the mocks but doesn't test anything as-is.""" |
18 def setUp(self): | 20 def setUp(self): |
19 super(Breakpad, self).setUp() | 21 super(Breakpad, self).setUp() |
20 self.mox.StubOutWithMock(breakpad.atexit, 'register') | 22 self.mox.StubOutWithMock(breakpad.atexit, 'register') |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 def testSendException(self): | 111 def testSendException(self): |
110 obj = Exception('foo') | 112 obj = Exception('foo') |
111 obj.msg = 'a message' | 113 obj.msg = 'a message' |
112 self._check(obj, 'foo\nMsg: a message') | 114 self._check(obj, 'foo\nMsg: a message') |
113 | 115 |
114 | 116 |
115 | 117 |
116 if __name__ == '__main__': | 118 if __name__ == '__main__': |
117 import unittest | 119 import unittest |
118 unittest.main() | 120 unittest.main() |
OLD | NEW |