sookasa / box.py

Python client for Box
43 stars 25 forks source link

Add delete_folder() method. #6

Closed echelon closed 10 years ago

echelon commented 10 years ago

I don't do pull requests frequently, so sorry if I botched this.

Needed this functionality for something I'm writing.

I didn't add test case; I didn't want to provision another Box account and tokens to run. (Sorry!) Also, possibly watch out for spaces/tabs--my vim may have converted them. I wasn't sure you wanted your code wrapped either.

tals commented 10 years ago

No worries :)

About to the tests: we don't actually do any calls to Box for those. We just do mocking and verify that the URL and parameters are the way we expect them to be (compared with docs/requests that passed). Check the tests in tests/test_client.py for a reference

safijari commented 10 years ago

So, I just started working with box.py. I will be needing the delete folder functionality for what I'm doing, and I'm kinda new to the whole github thing so I'm not sure what the proper way of using echelon's new code is. Should I just copy-paste it into the the module files I'm already using?

tals commented 10 years ago

Hey echelon - can you add tests so that I can merge it in? :)

echelon commented 10 years ago

I added tests as well as a fix for the delete_folder() method in 7340c45.

I've never used flexmock before. Is testing against params={} as opposed to an implicit params=None okay?

tals commented 10 years ago

Yeah - it matches whatever you pass to it. Since you're passing an empty dict (when recursive isn't true), you should pass an empty dict there too :)