Commit 18df9f5b by dgrtwo

Set up cloudcode directory as package_data so it would be included in tests not…

Set up cloudcode directory as package_data so it would be included in tests not run in the downloaded directory. Also set up a tests.run_tests() function so that one wouldn't have to download setup.py to run tests, and modified README. Fixes #37
parent 728c492b
......@@ -52,9 +52,10 @@ in the app and may accidentally replace or change existing objects.
* install the [Parse CloudCode tool](https://www.parse.com/docs/cloud_code_guide)
You can then test the installation by running:
You can then test the installation by running the following in a Python prompt:
python setup.py test
from parse_rest import tests
tests.run_tests()
Usage
......
......@@ -441,6 +441,12 @@ class TestUser(unittest.TestCase):
'Failed to batch update user data: updatedAt not changed')
def run_tests():
"""Run all tests in the parse_rest package"""
tests = unittest.TestLoader().loadTestsFromNames(['parse_rest.tests'])
t = unittest.TextTestRunner(verbosity=1)
t.run(tests)
if __name__ == "__main__":
# command line
......
import os
from distutils.core import setup, Command
from unittest import TextTestRunner, TestLoader
......@@ -21,10 +22,12 @@ class TestCommand(Command):
setup(
name='parse_rest',
version='0.2.20141002',
version='0.2.20141003',
description='A client library for Parse.com\'.s REST API',
url='https://github.com/dgrtwo/ParsePy',
packages=['parse_rest'],
package_data={"parse_rest":
[os.path.join("cloudcode", "*", "*")]},
maintainer='David Robinson',
maintainer_email='dgrtwo@princeton.edu',
cmdclass={'test': TestCommand},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment