# Path: streamcorpus_pipeline/_exceptions.py
# class FailedExtraction(PipelineBaseException):
#     pass
# 
# class ConfigurationError(PipelineBaseException, yakonfig.ConfigurationError):
#     pass
# 
# class FailedVerification(Exception):
#     '''Raised when an md5 verification fails.
#     '''
#     pass


    from cStringIO import StringIO
    from StringIO import StringIO
from functools import partial
from operator import itemgetter
from backports import lzma
    from dossier.fc import FeatureCollection, FeatureCollectionChunk
from streamcorpus_pipeline._exceptions import FailedExtraction, \
    ConfigurationError, FailedVerification
import hashlib
import logging
import os
import os.path as path
import tarfile
import tempfile
import urllib2
import uuid
import pytest
import yakonfig
import streamcorpus
import streamcorpus_pipeline._s3_storage as s3stage
from __future__ import absolute_import, division, print_function
try:
except ImportError:


logger = logging.getLogger(__name__)

try:
except ImportError:
    logger.info('failed to load dossier.fc', exc_info=True)
    dossier = None




# Skip all tests in this module if the AWS credentials are not in the
# environment.
pytestmark = pytest.mark.skipif(
    not os.getenv('AWS_ACCESS_KEY_ID'),
    reason='Requires AWS keys in environment. Set the following: '
           'AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_TEST_BUCKET.')


@pytest.fixture(scope='function')
def bucket_name():
    return os.getenv('AWS_TEST_BUCKET') or 'diffeo-test'



# Path: streamcorpus_pipeline/_exceptions.py
# class FailedExtraction(PipelineBaseException):
#     pass
# 
# class ConfigurationError(PipelineBaseException, yakonfig.ConfigurationError):
#     pass
# 
# class FailedVerification(Exception):
#     '''Raised when an md5 verification fails.
#     '''
#     pass


# Path: streamcorpus_pipeline/tests/test_s3_storage.py
    from cStringIO import StringIO
    from StringIO import StringIO
from functools import partial
from operator import itemgetter
from backports import lzma
    from dossier.fc import FeatureCollection, FeatureCollectionChunk
from streamcorpus_pipeline._exceptions import FailedExtraction, \
    ConfigurationError, FailedVerification
import hashlib
import logging
import os
import os.path as path
import tarfile
import tempfile
import urllib2
import uuid
import pytest
import yakonfig
import streamcorpus
import streamcorpus_pipeline._s3_storage as s3stage

from __future__ import absolute_import, division, print_function
try:
except ImportError:


logger = logging.getLogger(__name__)

try:
except ImportError:
    logger.info('failed to load dossier.fc', exc_info=True)
    dossier = None




# Skip all tests in this module if the AWS credentials are not in the
# environment.
pytestmark = pytest.mark.skipif(
    not os.getenv('AWS_ACCESS_KEY_ID'),
    reason='Requires AWS keys in environment. Set the following: '
           'AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_TEST_BUCKET.')


@pytest.fixture(scope='function')
def bucket_name():
    return os.getenv('AWS_TEST_BUCKET') or 'diffeo-test'



@pytest.fixture(scope='function')