def test_validation_passes_on_upload(self, mock_open):
invalid_file = StringIO.StringIO()
invalid_file.write(VALID_CSV)
mock_upload = MockFieldStorage(invalid_file, 'invalid.csv')
dataset = factories.Dataset()
valid_stream = io.BufferedReader(io.BytesIO(VALID_CSV))
with mock.patch('io.open', return_value=valid_stream):
resource = call_action(
'resource_create',
package_id=dataset['id'],
format='CSV',
upload=mock_upload
)
assert_equals(resource['validation_status'], 'success')
assert 'validation_timestamp' in resource
评论列表
文章目录