Skip to content

Commit

Permalink
Remove integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed May 15, 2013
1 parent 2a0263e commit 2b00486
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 213 deletions.
3 changes: 0 additions & 3 deletions tests/settings_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@
SQLALCHEMY_DATABASE_URI = 'sqlite://'

NAME = 'datapusher'

CKAN_HOST = 'localhost:5000'
USER_API_KEY = '6fff67c1-a5a8-4120-9957-281aab385500'
7 changes: 7 additions & 0 deletions tests/static/simple.ssv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
date;temperature;place
2011-01-01;1;Galway
2011-01-02;-1;Galway
2011-01-03;0;Galway
2011-01-01;6;Berkeley
2011-01-02;8;Berkeley
2011-01-03;5;Berkeley
23 changes: 20 additions & 3 deletions tests/test_acceptance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'''
Test the whole datapusher but do not push to the datastore.
The difference to the integration tests is that these tests can
run on travis without a running CKAN and datastore. These testsdo not
run on travis without a running CKAN and datastore. These tests do not
mock the datastore but instead set the dry-run variable.
'''

Expand Down Expand Up @@ -154,8 +154,8 @@ def test_simple_tsv(self):

@httpretty.activate
def test_simple_ssv(self):
# semicilon separated, just a different separator to guess
self.register_urls('simple.csv', 'csv', 'application/csv')
# semicolon separated, just a different separator to guess
self.register_urls('simple.ssv', 'csv', 'application/csv')
data = {
'api_key': self.api_key,
'job_type': 'push_to_datastore',
Expand Down Expand Up @@ -252,3 +252,20 @@ def test_weird_header(self):
assert_equal(len(results), 82)
assert_equal(headers[1]['id'].strip(), u'1985')
assert_equal(results[1]['column_1'].strip(), u'Gefäßchirurgie')

@httpretty.activate
def test_long_file(self):
self.register_urls('long.csv', 'csv')
data = {
'api_key': self.api_key,
'job_type': 'push_to_datastore',
'metadata': {
'ckan_url': 'http://%s/' % self.host,
'resource_id': self.resource_id
}
}

headers, results = jobs.push_to_datastore(None, data, web.queue, True)
results = list(results)
assert_equal(len(headers), 1)
assert_equal(len(results), 4000)
204 changes: 0 additions & 204 deletions tests/test_integration.py

This file was deleted.

6 changes: 3 additions & 3 deletions tests/test_mocked.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
'''
Test the whole datapusher but mock the datastore. The difference to the import tests
is that these tests can run on travis without a running CKAN and datastore.
Test the whole datapusher but mock the CKAN datastore.
'''

import os
Expand Down Expand Up @@ -69,7 +69,7 @@ def register_urls(self):
content_type="application/json")

@httpretty.activate
def test_simple_csv_basic(self):
def test_simple_csv(self):
self.register_urls()
data = {
'api_key': self.api_key,
Expand Down
1 change: 1 addition & 0 deletions tests/test_web.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
'''
Test whether the service can be started properly and whether the
configuration and the jobs are loaded.
Expand Down

0 comments on commit 2b00486

Please sign in to comment.