hayd / pep8radius

PEP8 clean only the parts of the files touched since the last commit, a previous commit or (the merge-base of) a branch.
MIT License
183 stars 9 forks source link

Start towards tests #12

Closed hayd closed 10 years ago

hayd commented 10 years ago

Start towards #1. These tests aren't passing yet (small bug in autopep8), should write instructions as a script (same for hg):

cd tests
git init
git add bad_original.py
git commit -m 'blah'

In fact that probably makes sense in a script.

schodge commented 10 years ago

Are the tests in the original posts passing now? If so, I'll try them on a Windows machine at work tomorrow using WinPython to get that data point.

hayd commented 10 years ago

@schodge good question, they may be with autopep8 from github (I pushed a fix which should fix the test)... I'll ping when a new autopep8 is released and get test suite up and running properly. Waiting on a pretty tricky PR of mine to fix indentation on subset of file.

To run tests you need to go to test dir, create git repo, commit the original.py file, before running tests. (the same with hg if you have it). Now you can run nosetests (or whatever). Atm only one test... :s

schodge commented 10 years ago

@hayd Can we set up a repo / subrepo here that a test script can download, programmatically change a file, and commit? Well, the last two parts are easy enough, my question is really about how to set up part of this repo just to test? Then shell out the git commands, modify a file, shell out more git, run tests... ?

hayd commented 10 years ago

So that's kinda what this test_btyfi file does (it copies to an assumed already existing file in the repo).

It doesn't do the set up. imo this should be in a separate script, which is put in the post install on travis (if you're not travis then you basically just run once). I thought about just including the repo, but git doesn't let you commit a repo and it gets pretty noisy... I think script solution is good.

schodge commented 10 years ago

I'll try to work on it this weekend.

hayd commented 10 years ago

@schodge tests should now work (they require the master branch of autopep8, pip install mercurial too and you should be able to test ).

I only have one test atm, but it passes with both git and hg.