Skip to content

Commit

Permalink
better tests structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jmg committed Jan 24, 2014
1 parent be2bd3e commit ce09b9e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
dist
build
*egg-info
test_data.json
test_data.py
1 change: 1 addition & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python tests/test.py
Empty file added tests/__init__.py
Empty file.
1 change: 1 addition & 0 deletions tests/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python tests/test.py
7 changes: 3 additions & 4 deletions test.py → tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
from pyfb import Pyfb

try:
with open("test_data.json") as f:
keys = json.loads(f.read())
from test_data import config
except IOError:
print "\nERROR! You must have a test_data.json file providing the facebook app id and the access token."
print "\nExample:"
Expand All @@ -21,8 +20,8 @@ class PyfbTests(unittest.TestCase):
pyfb_args = {}

def setUp(self):
self.pyfb = Pyfb(keys["FACEBOOK_APP_ID"], **self.pyfb_args)
self.pyfb.set_access_token(keys["FACEBOOK_TOKEN"])
self.pyfb = Pyfb(config["FACEBOOK_APP_ID"], **self.pyfb_args)
self.pyfb.set_access_token(config["FACEBOOK_TOKEN"])
self.me = self.pyfb.get_myself()

def test_auth(self):
Expand Down

0 comments on commit ce09b9e

Please sign in to comment.