OLD | NEW |
1 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) | 1 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions | 4 # modification, are permitted provided that the following conditions |
5 # are met: | 5 # are met: |
6 # 1. Redistributions of source code must retain the above copyright | 6 # 1. Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # 2. Redistributions in binary form must reproduce the above copyright | 8 # 2. Redistributions in binary form must reproduce the above copyright |
9 # notice, this list of conditions and the following disclaimer in the | 9 # notice, this list of conditions and the following disclaimer in the |
10 # documentation and/or other materials provided with the distribution. | 10 # documentation and/or other materials provided with the distribution. |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 | 29 |
30 class TextFileReaderTest(LoggingTestCase): | 30 class TextFileReaderTest(LoggingTestCase): |
31 | 31 |
32 class MockProcessor(ProcessorBase): | 32 class MockProcessor(ProcessorBase): |
33 | 33 |
34 """A processor for test purposes. | 34 """A processor for test purposes. |
35 | 35 |
36 This processor simply records the parameters passed to its process() | 36 This processor simply records the parameters passed to its process() |
37 method for later checking by the unittest test methods. | 37 method for later checking by the unittest test methods. |
38 | |
39 """ | 38 """ |
40 | 39 |
41 def __init__(self): | 40 def __init__(self): |
42 self.processed = [] | 41 self.processed = [] |
43 """The parameters passed for all calls to the process() method.""" | 42 """The parameters passed for all calls to the process() method.""" |
44 | 43 |
45 def should_process(self, file_path): | 44 def should_process(self, file_path): |
46 return not file_path.endswith('should_not_process.txt') | 45 return not file_path.endswith('should_not_process.txt') |
47 | 46 |
48 def process(self, lines, file_path, test_kwarg=None): | 47 def process(self, lines, file_path, test_kwarg=None): |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 144 |
146 self._file_reader.process_paths([dir, file_path1]) | 145 self._file_reader.process_paths([dir, file_path1]) |
147 processed = [(['bar'], file_path2, None), | 146 processed = [(['bar'], file_path2, None), |
148 (['foo'], file_path1, None)] | 147 (['foo'], file_path1, None)] |
149 self._assert_file_reader(processed, 2) | 148 self._assert_file_reader(processed, 2) |
150 | 149 |
151 def test_count_delete_only_file(self): | 150 def test_count_delete_only_file(self): |
152 self._file_reader.count_delete_only_file() | 151 self._file_reader.count_delete_only_file() |
153 delete_only_file_count = self._file_reader.delete_only_file_count | 152 delete_only_file_count = self._file_reader.delete_only_file_count |
154 self.assertEqual(delete_only_file_count, 1) | 153 self.assertEqual(delete_only_file_count, 1) |
OLD | NEW |