Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
timmow committed Jul 4, 2014
1 parent 33c2df2 commit 04af8b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion backdrop/admin/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ def upload(data_set_name):

def _store_data(data_set_config):
parse_file = create_parser(data_set_config)
data_set2 = NewDataSet(storage, data_set_config)
data_set = client.DataSet.from_group_and_type(
app.config['BACKDROP_URL'] + '/data',
data_set_config.data_group,
Expand Down
12 changes: 4 additions & 8 deletions tests/admin/test_file_upload_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ def test_data_hits_the_backdrop_client_when_uploading_xlsx(self, mock_client_cla
@stub_clamscan(is_virus=False)
@patch("performanceplatform.client.DataSet.post")
def test_error_cases_when_post_to_backdrop_fails(self, mock_post):
#something about catching http errors - passing through? And no longer worry about mongo errors
self._sign_in("test@example.com")
mock_post.side_effect = RequestException()
response = self.do_simple_file_post()
Expand All @@ -128,7 +127,6 @@ def test_error_cases_when_post_to_backdrop_fails(self, mock_post):
@stub_clamscan(is_virus=False)
@patch("backdrop.core.upload.create_parser")
def test_error_cases_when_upload_validation_fails(self, mock_parser):
#something about catching http errors - passing through? And no longer worry about mongo errors
self._sign_in("test@example.com")
mock_parser.side_effect = ValidationError()
response = self.do_simple_file_post()
Expand Down Expand Up @@ -159,16 +157,15 @@ def test_upload_applies_filters(self, mock_client_class):
'type',
token='some_token'
)
#TODO check write api accepts this kind of timestamp
stored_filtered_data= {
"calls_answered_by_advisor": 56383,
"sorn_web": 108024,
"_timestamp": '2007-07-01T00:00:00+00:00'
}
#This is definitely not incredibly obtuse
#it is basically saying that one of the bits of data that we posted
#has this entries in it which have something to do with the operation of a filter
#this could not work if filters were not working... apparently.
# This is definitely not incredibly obtuse
# it is basically saying that one of the bits of data that we posted
# has this entries in it which have something to do with the operation of a filter
# this could not work if filters were not working... apparently.
pos_args = mock_post.call_args[0]
post_arg = pos_args[0]
assert_that(post_arg[0], has_entries(stored_filtered_data))
Expand All @@ -192,7 +189,6 @@ def test_upload_auto_generate_ids(self, mock_post):
}
)

#is this tested elsewhere? where are the filters applied?
assert_that(response, has_status(200))
assert_that(response, has_status(200))

Expand Down

0 comments on commit 04af8b0

Please sign in to comment.