josuebrunel / yahoo-fantasy-sport

Python Yahoo! Fantasy Sports
MIT License
28 stars 9 forks source link

players api #18

Closed josuebrunel closed 9 years ago

josuebrunel commented 9 years ago

It seems to be done in your future pull request. Don't forget to add some tests in the tests.py file. Thanks

peacing commented 9 years ago

@josuebrunel, I started adding some tests to the file. Most of them are commented out because I've just been testing one at a time.

get_players - passed (but not with a filter) get_teams - passed get_teams - passed

For some reason the other player functions, like get_players_percent_owned aren't working. I get a response that looks like:

_signature=Uq%2BHYVWHh4BwazMub5Z1Gr1%2B%2Fow%3D HTTP/1.1" 400 1012 [2015-06-28 12:48:08,399 DEBUG] [root.tests.test_get_players_draft_analysis] { "error": { "description": "Resource players=223.p.5479 not supported.",

Because it says resource not supported, I'm concerned on Yahoo's end they stopped making that data available for some reason. When you get a chance, can you try to testing out one of the players functions?

According to the documentation the players functions are also supposed to be accessible as a sub-resource of the Roster Collection, so maybe they would work that way. I tried that last night quickly and still got an error.

I'll continue writing functions/testing in the meantime

Thanks,

josuebrunel commented 9 years ago

Thank you Paul. I will clone your repository and run some tests to figure out what's working.

josuebrunel commented 9 years ago

By the way, if you want to run test for specific method, you can do something like this :

$ run_tests.sh TestFantasySport test_get_teams_players

A good improvment, would be to write a class (test class ) for each kind of resource :

class TestFantasySportLeagues(unittest.TestCase):
...
class TestFantasySportGames(unittest.TestCase):
...
class TestFantasySportPLayers(unittest.TestCase):

Then we will be able to run test as follow :

$ run_tests.sh TestFantasySportTeams test_get_teams_players

I will wait for your pull request (pull request on the development branch ) to carry on unless i find another feature to work on.

By the way, good job on what you've done so far.

peacing commented 9 years ago

Thanks for the tips,I'm a much more effective tester now. Also, in case you start take a look at the issue I brought up above regarding players functions, no need to, I figured out the problem and everything works. I should have lots of updates very soon!

josuebrunel commented 9 years ago

Thanks @unpairestgood . As soon as you're done submit a pull request and i'll merge it . Now we have both a good understanding of what to do, we need to improve the way we will work on the project ( really sorry if i may seem bossy :disappointed: don't worry i will always keep it cool :sunglasses: ) by doing as follow :

$ git add file_changed.py another_change.py
$ git commit -m "#18 : description of the changes"

That will help us easily track changes. It don't mind if one commit is related to only one file, so do as you feel it. You can check a better example here

Thank you Paul, have fun :wink: , i really enjoy working with you. Have a good one

peacing commented 9 years ago

@josuebrunel Without getting too sentimental, I'll say the feeling is mutual. Sounds good regarding our workflow, I'd still have very basic coding practices without you, so keep bossing me around!

I'm working on a blog post tonight but will try to properly open an issue and commit to it (and maybe even a pull request) tomorrow. Thank you.

josuebrunel commented 9 years ago

@unpairestgood thanks to you Paul. Btw good job on the test module. As soon as i have your pull request, we will try to organize the way we work, so we won't step on each other's toes. Keep me posted and have a good one