Skip to content

Commit

Permalink
Shoot in the dark
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem committed Mar 1, 2016
1 parent b4bccb4 commit eecada6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ matrix:
env:
- TOX_ENV=py35
before_script:
- sudo sed -i "s/fsync/#fsync/" /etc/postgresql/9.4/main/postgresql.conf
- sudo /etc/init.d/postgresql restart
- psql -c "CREATE DATABASE testdb ENCODING 'UTF8' TEMPLATE template0;" -U postgres
install:
- if [[ $ACTION != loadtest_tutorial && $ACTION != loadtest_simulation ]]; then pip install tox; fi
Expand Down
10 changes: 5 additions & 5 deletions loadtests/loadtest/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def create(self):
self.collection_url(),
data=json.dumps({'data': article}),
headers={'Content-Type': 'application/json'})
self.incr_counter(resp.status_code)
self.incr_counter('status-%s' % resp.status_code)
self.assertEqual(resp.status_code, 201)

def create_put(self):
Expand All @@ -117,7 +117,7 @@ def create_put(self):
self.record_url(uuid.uuid4()),
data=json.dumps({'data': article}),
headers={'Content-Type': 'application/json'})
self.incr_counter(resp.status_code)
self.incr_counter('status-%s' % resp.status_code)
self.assertEqual(resp.status_code, 201)

def batch_create(self):
Expand Down Expand Up @@ -158,13 +158,13 @@ def filter_sort(self):
query_url = '&'.join(['='.join(param) for param in queryparams])
url = self.collection_url() + '?' + query_url
resp = self.session.get(url)
self.incr_counter(resp.status_code)
self.incr_counter('status-%s' % resp.status_code)
self.assertEqual(resp.status_code, 200)

def _patch(self, url, data, status=200):
data = json.dumps(data)
resp = self.session.patch(url, data)
self.incr_counter(resp.status_code)
self.incr_counter('status-%s' % resp.status_code)
self.assertEqual(resp.status_code, status)

def _run_batch(self, data):
Expand Down Expand Up @@ -217,7 +217,7 @@ def batch_update(self):

def delete(self):
resp = self.session.delete(self.random_url)
self.incr_counter(resp.status_code)
self.incr_counter('status-%s' % resp.status_code)
self.assertEqual(resp.status_code, 200)

def batch_delete(self):
Expand Down

0 comments on commit eecada6

Please sign in to comment.