| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 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 # pylint: disable=protected-access |
| 7 |
| 6 import os | 8 import os |
| 7 import sys | 9 import sys |
| 8 import unittest | 10 import unittest |
| 9 from xml.etree import ElementTree | 11 from xml.etree import ElementTree |
| 10 | 12 |
| 11 import emma_coverage_stats | 13 import emma_coverage_stats |
| 12 from pylib import constants | 14 from pylib import constants |
| 13 | 15 |
| 14 sys.path.append(os.path.join( | 16 sys.path.append(os.path.join( |
| 15 constants.DIR_SOURCE_ROOT, 'third_party', 'pymock')) | 17 constants.DIR_SOURCE_ROOT, 'third_party', 'pymock')) |
| 16 import mock # pylint: disable=F0401 | 18 import mock # pylint: disable=import-error |
| 17 | 19 |
| 18 EMPTY_COVERAGE_STATS_DICT = { | 20 EMPTY_COVERAGE_STATS_DICT = { |
| 19 'files': {}, | 21 'files': {}, |
| 20 'patch': { | 22 'patch': { |
| 21 'incremental': { | 23 'incremental': { |
| 22 'covered': 0, 'total': 0 | 24 'covered': 0, 'total': 0 |
| 23 } | 25 } |
| 24 } | 26 } |
| 25 } | 27 } |
| 26 | 28 |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 mock_open = mock.mock_open() | 557 mock_open = mock.mock_open() |
| 556 mock_open.side_effect = [mock.mock_open(read_data=side_effect).return_value | 558 mock_open.side_effect = [mock.mock_open(read_data=side_effect).return_value |
| 557 for side_effect in side_effects] | 559 for side_effect in side_effects] |
| 558 with mock.patch('__builtin__.open', mock_open): | 560 with mock.patch('__builtin__.open', mock_open): |
| 559 return func(**kwargs), mock_open | 561 return func(**kwargs), mock_open |
| 560 | 562 |
| 561 | 563 |
| 562 if __name__ == '__main__': | 564 if __name__ == '__main__': |
| 563 # Suppress logging messages. | 565 # Suppress logging messages. |
| 564 unittest.main(buffer=True) | 566 unittest.main(buffer=True) |
| OLD | NEW |