'Connection failure on to docker socket should raise exception'

def test_connection_failure(self):

    self.mocks.configure_mock('docker', {'side_effect': DockerException})
    build_env = DockerEnvironment(version=self.version, project=self.project, build={'id': DUMMY_BUILD_ID})
    def _inner():
        with build_env:
            self.fail('Should    not    hit    this')
    self.assertRaises(BuildEnvironmentError, _inner)
    self.assertFalse(self.mocks.api()(DUMMY_BUILD_ID).put.called)
