josuebrunel / yahoo-fantasy-sport

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

tests #5

Closed josuebrunel closed 9 years ago

josuebrunel commented 9 years ago

Hello @unpairestgood , Could you please help test my development. Nothing is on the master branch yet, but there are already 2 methods in the development branch. Don't forget to put your oauth credentials in a file named oauth.json

$ ./run_tests.sh TestFantasySports test_get_game_info

Your help is greatly appreciated

peacing commented 9 years ago

@josuebrunel I'm happy to help out. I just tried running a test case and got an error... I'm not sure if it's something in the code or I'm not running the test case correctly (it's likely me). Here's what I've done so far:

1) In the GitHub application installed on my computer I cloned your yahoo-fantasy-sport repo to the folder yahoo-fantasy-sport, which is in a folder on my hard drive called pyth

2) In the yahoo-fantasy-sport folder I added a document called 'oauth.json'with my consumer secret and key

3) I changed my working directory in terminal to be the yahoo-fantasy-sport folder

4) In the terminal window I typed in: ./run_tests.sh TestFantasySports test_get_game_info

The error message I got back was:

screen shot 2015-06-22 at 7 33 08 pm

Let me know if this was correct, your thoughts.

Thanks,

josuebrunel commented 9 years ago

@unpairestgood, first of all thank you. My bad, I forgot to tell you to use a virtual environment. The good thing is that from what i can see from your screenshot you use a Mac :smile: I hope you use macport too

pip and virtualenv installation
sudo port install git # if not already installed
sudo port install py27-pip # if not already installed
sudo port install py27-virtualenv # if not already installed
in the working directory
$ git clone https://github.com/josuebrunel/yahoo-fantasy-sport
$ cd yahoo-fantasy-sport 
$ git checkout development # changes the branch you're working on
$ virtualenv env # create the virtualenv
$ source env/bin/activate # active the virtualenv 
(env)$ pip install -r requirements.txt # install package in the requirements.txt file in the virtual env
(env)$ ./run_tests.sh
tips ( just in case you're new to virtualenv )

It is highly recommended to use virtualenvs when you develop in Python. It helps you install libraries and test or use them without messing with your real environment.

peacing commented 9 years ago

@josuebrunel I followed the steps you outlined above (thank you, they were very clear and I have a better idea of how to use venv's now) and ran the code again. Once again there was an error, which is one I remember seeing when I first started trying to use Yahoo's API, about how urllib3 can't configure SSL appropriately.

I'm assuming you've seen this error before too, so in typical fashion I'm going to provide some screenshots:

screen shot 2015-06-23 at 1 19 34 am screen shot 2015-06-23 at 1 20 14 am

That's what happened, I'm always happy to help out so feel free to continue to reach out. These are obviously good learning experiences for me.


I've been working on coding an algorithm that uses projections for each player to determine who are the best players to start and who should be on the bench. I'll make that available tomorrow sometime on github and it'd be great to get any feedback on it. Thank you!

josuebrunel commented 9 years ago

Thanks @unpairestgood . That helped me out :smile: . I was just using the wrong OAuth version. In my tests i used OAuth2 instead of OAuth1. I'm gonna push the modifications on the master branch as soon as i'm done. I just have to set up Continuous Integration with travis .

Have a good one Paul, and thanks again

josuebrunel commented 9 years ago

Just to let you know, i'm trying to develop an easy to use python API for yahoo-fantasy-sports. Your contribution is greatly appreciated. It will greatly help me to work with you on this project. All your suggestions are welcomed, so please don't hesitate.

I do believe that we will do something great together. You do have a better user experience than me on Yahoo Fantasy Sport.

One more time, thank you for your contribution @unpairestgood

peacing commented 9 years ago

Sounds good. I'm busy tomorrow but Thursday and this weekend I'll definitely take a look at what you're doing and submit ideas I think people would find useful.

josuebrunel commented 9 years ago

ok thanks paul