Could you break this up into separate functions? This could get difficult to test, if I need to debug things in the future. If they were separate functions, I could do:

```python
$ python -m unittest test_autopep8.UnitTests.test_foo_bar
```