Open kencochrane opened 11 years ago
It would be good to mention in setup.rst that you either need to add a user 'ken' with password 'emily', or you need to change these lines in worker/api.py
: (I changed it to admin/admin since i already had that user setup from the syncdb)
API_URL = "http://localhost:8000/api/v1/"
API_USER = "admin"
API_PASSWORD = "admin"
If you don't do this, you'll get this error when you try to run the run.py
:
2013-10-07 22:06:43,743 INFO: Starting worker
2013-10-07 22:06:43,743 INFO: make repo directory /tmp/repos
2013-10-07 22:06:43,743 INFO: start daemon
2013-10-07 22:06:43,743 INFO: start queue_analytics_daemon
2013-10-07 22:06:43,743 INFO: REDIS local server
2013-10-07 22:06:43,746 INFO: Starting... {"project_id": 1, "project_score_id": 1, "name": "django-deployer", "repo_url": "https://github.com/natea/django-deployer", "slug": "django-deployer"}
2013-10-07 22:06:43,746 INFO: adding .git to url https://github.com/natea/django-deployer
2013-10-07 22:06:45,209 INFO: Cloned repo dir = /tmp/repos/tmplEi2JQ
2013-10-07 22:06:45,313 INFO: attributes.attrib_github1: started
2013-10-07 22:06:45,336 INFO: Starting new HTTPS connection (1): api.github.com
2013-10-07 22:06:45,887 INFO: attributes.attrib_github1: finished
2013-10-07 22:06:45,889 INFO: hooks.hook_api: started
2013-10-07 22:06:45,890 INFO: Starting new HTTP connection (1): localhost
2013-10-07 22:06:45,899 ERROR: hooks.hook_api: returned an error. Retrying in 1 second...
Traceback (most recent call last):
File "run.py", line 64, in run_module
result = mod.run(*args)
File "/Users/nateaune/Dropbox/code/scorinator/worker/hooks/hook_api.py", line 34, in run
score_attrib_id = score_attrib.get('id', None)
AttributeError: 'NoneType' object has no attribute 'get'
Well, changing it to admin/admin was no good because it broke the tests! :P
________________________________________________________________ TestAPIParams.test_default ________________________________________________________________
self = <worker.tests.test_api.TestAPIParams instance at 0x10e1a2368>
def test_default(self):
from api import API_URL, API_USER, API_PASSWORD
assert API_URL == "http://localhost:8000/api/v1/"
> assert API_USER == "ken"
E assert 'admin' == 'ken'
E - admin
E + ken
worker/tests/test_api.py:9: AssertionError
@natea good points, I attempted to improve the docs. Also removed that silly test :)
Intro setup API