tests/subfiles.py

changeset 85
4438502fd3e0
parent 83
bd840d5dc8d8
child 89
d2b277cb948e
equal deleted inserted replaced
84:55d52e25267f 85:4438502fd3e0
129 ), 129 ),
130 ) 130 )
131 @problem_type('moved-file-used', 131 @problem_type('moved-file-used',
132 severity = 'hold', 132 severity = 'hold',
133 message = lambda moved_file, new_file: 133 message = lambda moved_file, new_file:
134 str.format('subfile "{moved_file}" has been moved to "{new_file}"', 134 str.format('subfile "{moved_file}" has been moved to "{new_file}.dat"',
135 **locals(), 135 **locals(),
136 ), 136 ),
137 ) 137 )
138 @problem_type('unnecessary-scaling', 138 @problem_type('unnecessary-scaling',
139 severity = 'warning', 139 severity = 'warning',
181 ) 181 )
182 failed_subfiles.add(path) 182 failed_subfiles.add(path)
183 else: 183 else:
184 # Test for use of moved-to files 184 # Test for use of moved-to files
185 import re 185 import re
186 match = re.search(r'^\~Moved(?: to (\w+))?$', subfile.description) 186 match = re.search(r'^\~Moved(?: to (.+))?$', subfile.description)
187 if match: 187 if match:
188 yield report_problem( 188 yield report_problem(
189 'moved-file-used', 189 'moved-file-used',
190 bad_object = subfile_reference, 190 bad_object = subfile_reference,
191 moved_file = path, 191 moved_file = path,

mercurial