def check_updated_files(self, module_ops=None):
if module_ops is None:<EOL><INDENT>module_ops = {}<EOL>self.atexit_mock.assert_not_called()<EOL><DEDENT>else:<EOL><INDENT>self.atexit_mock.assert_called_once_with(Baseline._atexit_callback)<EOL><DEDENT>path_to_module = {}<EOL>for module, ops in module_ops.items():<EOL><INDENT>path = os.path.abspath(module.__file__).replace('<STR_LIT>', '<STR_LIT>')<EOL>path_to_module[path] = module<EOL><DEDENT>updated_scripts = Baseline._atexit_callback()<EOL>self.assertEqual(sorted(updated_scripts), sorted(path_to_module))<EOL>for path, module in path_to_module.items():<EOL><INDENT>actual = '<STR_LIT:\n>'.join(updated_scripts[path].lines)<EOL>with io.open(path, '<STR_LIT:r>', encoding='<STR_LIT:utf-8>') as handle:<EOL><INDENT>expect = handle.read()<EOL><DEDENT>for pattern, replacement in module_ops[module]:<EOL><INDENT>expect = expect.replace(pattern, replacement)<EOL><DEDENT>if actual != expect:<EOL><INDENT>title_len = <NUM_LIT><EOL>print('<STR_LIT>'.format(path).center(title_len, '<STR_LIT:*>'))<EOL>print(actual)<EOL>print('<STR_LIT>'.format(path).center(title_len, '<STR_LIT:*>'))<EOL>print(expect)<EOL>print('<STR_LIT>'.format(path).center(title_len, '<STR_LIT:*>'))<EOL>print('<STR_LIT>'.join(difflib.ndiff(<EOL>expect.splitlines(True),<EOL>actual.splitlines(True))))<EOL>print('<STR_LIT:*>' * title_len)<EOL><DEDENT>self.assertTrue(actual == expect)<EOL><DEDENT>
Check pending file edits match expectations.

        If no module edit operations specified, check that baseline
        utility never registered to execute when the Python interpreter
        exits.  Otherwise check that the registration occurred and execute
        the same logic that was registered. Then check that the registered
        logic performed the expected module edit operations.

        Express the expected module operations expectations as a dictionary.
        Where the key is the module object containing the baseline
        instantiations that are expected to be edited. The dictionary
        value is a list of simple text (search, replace) patterns to apply
        to the original file content to formulate the expected edit.

        :param dict module_ops:
            expected edits in the form: {module: [(search, replace), ...]}

        :raises AssertionError:
            if actual edits do not match expected edits