Skip to content

Commit

Permalink
[#1797,tests][xs]: remove blackbox whole stack test as it is too frag…
Browse files Browse the repository at this point in the history
…ile for general use.

* E.g. depends on nginx port resource id etc ...
* Moved code to https://gist.github.com/1930787
  • Loading branch information
rufuspollock committed Feb 28, 2012
1 parent ac46a4d commit 4e08792
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions ckan/tests/functional/test_webstore.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from nose.tools import assert_equal
from pylons import config

from ckan.tests import *
from ckan.tests.pylons_controller import PylonsTestCase
Expand Down Expand Up @@ -43,32 +44,3 @@ def test_update(self):
# assert res.status in [401,302], res.status
assert res.status == 200

import json
import paste.fixture
import paste.proxy

app = paste.proxy.Proxy('http://localhost:8088')
testapp = paste.fixture.TestApp(app)

class TestItForReal:
'''This is a test using the real setup with elasticsearch.
It requires you to run nginx with config as per
https://github.com/okfn/elastic-proxy/blob/master/elasticproxy plus,
obviously, elasticsearch on port 9200.
'''
def test_01(self):
offset = '/api/resource/a687ea97-c4d6-4386-b5ac-365744c59662/data'
res = testapp.get(offset, status=400)
assert res.status == 400
data = {
"user": "hamlet",
"post_date": "2009-11-15T13:12:00",
"message": "Trying out elasticsearch, so far so good?"
}
data = json.dumps(data)
testapp.put(offset + '/1', data)
out = testapp.get(offset + '/1')
outdata = json.loads(out.body)
assert outdata['_source']['user'] == 'hamlet', outdata

0 comments on commit 4e08792

Please sign in to comment.