From ce09b9e4a63b1dfada4d6cd75e49f55464ee84fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Garc=C3=ADa?= Date: Thu, 23 Jan 2014 23:49:16 -0300 Subject: [PATCH] better tests structure --- .gitignore | 2 +- run_tests.sh | 1 + tests/__init__.py | 0 tests/run_tests.sh | 1 + test.py => tests/test.py | 7 +++---- 5 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 run_tests.sh create mode 100644 tests/__init__.py create mode 100644 tests/run_tests.sh rename test.py => tests/test.py (91%) diff --git a/.gitignore b/.gitignore index 4614454..b5b6619 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ dist build *egg-info -test_data.json \ No newline at end of file +test_data.py \ No newline at end of file diff --git a/run_tests.sh b/run_tests.sh new file mode 100644 index 0000000..9e6272b --- /dev/null +++ b/run_tests.sh @@ -0,0 +1 @@ +python tests/test.py \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/run_tests.sh b/tests/run_tests.sh new file mode 100644 index 0000000..9e6272b --- /dev/null +++ b/tests/run_tests.sh @@ -0,0 +1 @@ +python tests/test.py \ No newline at end of file diff --git a/test.py b/tests/test.py similarity index 91% rename from test.py rename to tests/test.py index 95c1470..3b6c110 100644 --- a/test.py +++ b/tests/test.py @@ -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:" @@ -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):