def check(self, original, modified, expected,
              test_name='check', options=None,
              cwd=TEMP_DIR, apply_config=False):
        temp_file = os.path.join(cwd, 'temp.py')

        with from_dir(cwd):
            options = parse_args(options, apply_config=apply_config)

        # TODO remove this color hack, and actually test printing color diff
        options.no_color = True

        with open(temp_file, 'w') as f:
            f.write(original)
        committed = self.successfully_commit_files([temp_file],
                                                   commit=test_name)

        with open(temp_file, 'w') as f:
            f.write(modified)

        options.verbose = 1
        r = Radius(vc=self.vc, options=options, cwd=cwd)
        with captured_output() as (out, err):
            r.fix()
        self.assertIn('would fix', out.getvalue())
        self.assertNotIn('@@', out.getvalue())
        options.verbose = 0

        options.diff = True
        r = Radius(vc=self.vc, options=options, cwd=cwd)
        with captured_output() as (out, err):
            r.fix()
        exp_diff = get_diff(modified, expected, temp_file)
        self.assert_equal(out.getvalue(), exp_diff, test_name)
        options.diff = False

        options.in_place = True
        r = Radius(vc=self.vc, options=options, cwd=cwd)
        # Run pep8radius
        r.fix()

        with open(temp_file, 'r') as f:
            result = f.read()
        self.assert_equal(result, expected, test_name)

        # Run pep8radius again, it *should* be that this doesn't do anything.
        out = pep8radius_main(options, vc=self.vc, cwd=cwd)
        self.assertEqual(out, '')

        with open(temp_file, 'r') as f:
            result = f.read()
        self.assert_equal(result, expected, test_name)
Modify original to modified, and check that pep8radius turns this
dataset/ETHPy150Open hayd/pep8radius/tests/test_radius.py/TestRadius.check