okfn/annotator-store — Issue #37: Tests fail
Author: ezietsman
Created: 2012-03-05 10:16:37+00:00
State: open

Hi, I'm trying to run the new store locally. After running through the installation, I get the following test failures:

E....E.........FFFF......................E.............
======================================================================
ERROR: Failure: ImportError (cannot import name db)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/pyenv/lib/python2.6/site-packages/nose/loader.py", line 390, in loadTestsFromName
addr.filename, addr.module)
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/pyenv/lib/python2.6/site-packages/nose/importer.py", line 39, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/pyenv/lib/python2.6/site-packages/nose/importer.py", line 86, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/annotator/model/__init__.py", line 4, in
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/annotator/model/consumer.py", line 4, in
ImportError: cannot import name db

======================================================================
ERROR: tests.test_annotation.TestAnnotation.test_save
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/pyenv/lib/python2.6/site-packages/nose/case.py", line 187, in runTest
self.test(*self.arg)
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/tests/test_annotation.py", line 24, in test_save
assert_in('id', a)
NameError: global name 'assert_in' is not defined
-------------------- >> begin captured logging << --------------------
pyes: DEBUG: Connecting to 127.0.0.1:9200
pyes: INFO: Starting new HTTP connection (1): 127.0.0.1
pyes.urllib3.connectionpool: DEBUG: "PUT /annotator_test HTTP/1.1" 200 31
pyes: DEBUG: Connecting to 127.0.0.1:9200
pyes: INFO: Starting new HTTP connection (1): 127.0.0.1
pyes.urllib3.connectionpool: DEBUG: "PUT /annotator_test/annotation/_mapping HTTP/1.1" 200 31
pyes: DEBUG: Connecting to 127.0.0.1:9200
pyes: INFO: Starting new HTTP connection (1): 127.0.0.1
pyes.urllib3.connectionpool: DEBUG: "POST /annotator_test/annotation HTTP/1.1" 201 102
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: tests.test_store.TestStore.test_search
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/pyenv/lib/python2.6/site-packages/nose/case.py", line 187, in runTest
self.test(*self.arg)
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/tests/test_store.py", line 250, in test_search
assert_in(res['rows'][0]['id'], [anno.id, anno2.id])
NameError: global name 'assert_in' is not defined
-------------------- >> begin captured logging << --------------------
pyes: DEBUG: Connecting to 127.0.0.1:9200
pyes: INFO: Starting new HTTP connection (1): 127.0.0.1
pyes.urllib3.connectionpool: DEBUG: "PUT /annotator_test HTTP/1.1" 200 31
pyes: DEBUG: Connecting to 127.0.0.1:9200
pyes: INFO: Starting new HTTP connection (1): 127.0.0.1
pyes.urllib3.connectionpool: DEBUG: "PUT /annotator_test/annotation/_mapping HTTP/1.1" 200 31
pyes: DEBUG: Connecting to 127.0.0.1:9200
pyes: INFO: Starting new HTTP connection (1): 127.0.0.1
pyes.urllib3.connectionpool: DEBUG: "POST /annotator_test/annotation HTTP/1.1" 201 102
pyes: DEBUG: Connecting to 127.0.0.1:9200
pyes: INFO: Starting new HTTP connection (1): 127.0.0.1
pyes.urllib3.connectionpool: DEBUG: "POST /annotator_test/annotation HTTP/1.1" 201 102
pyes: DEBUG: Connecting to 127.0.0.1:9200
pyes: INFO: Starting new HTTP connection (1): 127.0.0.1
pyes.urllib3.connectionpool: DEBUG: "POST /annotator_test/annotation HTTP/1.1" 201 102
pyes: DEBUG: Connecting to 127.0.0.1:9200
pyes: INFO: Starting new HTTP connection (1): 127.0.0.1
pyes.urllib3.connectionpool: DEBUG: "POST /_all/_refresh HTTP/1.1" 200 61
pyes.urllib3.connectionpool: DEBUG: "GET /_cluster/health HTTP/1.1" 200 228
pyes: DEBUG: Connecting to 127.0.0.1:9200
pyes: INFO: Starting new HTTP connection (1): 127.0.0.1
pyes.urllib3.connectionpool: DEBUG: "GET /annotator_test/annotation/_search HTTP/1.1" 200 1202
pyes: DEBUG: Connecting to 127.0.0.1:9200
pyes: INFO: Starting new HTTP connection (1): 127.0.0.1
pyes.urllib3.connectionpool: DEBUG: "GET /annotator_test/annotation/_count HTTP/1.1" 200 59
pyes: DEBUG: Connecting to 127.0.0.1:9200
pyes: INFO: Starting new HTTP connection (1): 127.0.0.1
pyes.urllib3.connectionpool: DEBUG: "GET /annotator_test/annotation/_search HTTP/1.1" 200 477
pyes: DEBUG: Connecting to 127.0.0.1:9200
pyes: INFO: Starting new HTTP connection (1): 127.0.0.1
pyes.urllib3.connectionpool: DEBUG: "GET /annotator_test/annotation/_count HTTP/1.1" 200 59
pyes: DEBUG: Connecting to 127.0.0.1:9200
pyes: INFO: Starting new HTTP connection (1): 127.0.0.1
pyes.urllib3.connectionpool: DEBUG: "GET /annotator_test/annotation/_search HTTP/1.1" 200 846
pyes: DEBUG: Connecting to 127.0.0.1:9200
pyes: INFO: Starting new HTTP connection (1): 127.0.0.1
pyes.urllib3.connectionpool: DEBUG: "GET /annotator_test/annotation/_count HTTP/1.1" 200 59
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: tests.test_auth.TestAuthenticator.test_verify_request
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/pyenv/lib/python2.6/site-packages/nose/case.py", line 187, in runTest
self.test(*self.arg)
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/tests/test_auth.py", line 89, in test_verify_request
assert self.auth.verify_request(request), "request should have been verified"
AssertionError: request should have been verified

======================================================================
FAIL: tests.test_auth.TestAuthenticator.test_verify_request_mixedcase_headers
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/pyenv/lib/python2.6/site-packages/nose/case.py", line 187, in runTest
self.test(*self.arg)
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/tests/test_auth.py", line 101, in test_verify_request_mixedcase_headers
assert self.auth.verify_request(request), "request with mixed-case headers should have been verified"
AssertionError: request with mixed-case headers should have been verified

======================================================================
FAIL: tests.test_auth.TestAuthenticator.test_verify_token
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/pyenv/lib/python2.6/site-packages/nose/case.py", line 187, in runTest
self.test(*self.arg)
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/tests/test_auth.py", line 84, in test_verify_token
assert self.auth.verify_token('Consumer', tok, 'alice', issue_time), "token should have been verified"
AssertionError: token should have been verified

======================================================================
FAIL: tests.test_auth.test_verify_token
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/pyenv/lib/python2.6/site-packages/nose/case.py", line 187, in runTest
self.test(*self.arg)
File "/home/ewald/programming/texas-sprint/okfn-annotator-store/tests/test_auth.py", line 38, in test_verify_token
assert auth.verify_token(MockConsumer, tok, 'alice', issue_time), "token should have been verified"
AssertionError: token should have been verified

----------------------------------------------------------------------
Ran 55 tests in 17.301s

FAILED (errors=3, failures=4)

The output from pip freeze gives

Flask==0.8
Flask-SQLAlchemy==0.15
Flask-WTF==0.5.2
Jinja==1.2
Jinja2==2.6
SQLAlchemy==0.7.4
WTForms==0.6.3
Werkzeug==0.8.3
-e git+https://github.com/okfn/annotator-store.git@53aebc3e5b77c2ce2ba292e22f72eaff8a1bc589#egg=annotator-v0.6.1
distribute==0.6.10
importlib==1.0.2
iso8601==0.1.4
mock==0.7.2
nose==1.0.0
pyes==0.16.0
thrift==0.8.0
wsgiref==0.1.2

I'm running Ubuntu 10.10 32bit with python 2.6.6