from raven.conf import load
from unittest2 import TestCase


class LoadTest(TestCase):
    def test_basic(self):
        dsn = 'https://foo:bar@sentry.local/1'
        res = {}
        load(dsn, res)
        self.assertEquals(res, {
            'SENTRY_PROJECT': '1',
            'SENTRY_SERVERS': ['https://sentry.local/api/store/'],
            'SENTRY_PUBLIC_KEY': 'foo',
            'SENTRY_SECRET_KEY': 'bar',
        })

    def test_path(self):
        dsn = 'https://foo:bar@sentry.local/app/1'
        res = {}
        load(dsn, res)
        self.assertEquals(res, {
            'SENTRY_PROJECT': '1',
            'SENTRY_SERVERS': ['https://sentry.local/app/api/store/'],
            'SENTRY_PUBLIC_KEY': 'foo',
            'SENTRY_SECRET_KEY': 'bar',
        })

@@ -1,12 +1,39 @@
+import logging%0Aimport mock%0A
 from raven.c
@@ -47,16 +47,31 @@
 ort load
+, setup_logging
 %0Afrom un
@@ -788,28 +788,685 @@
 RET_KEY': 'bar',%0A        %7D)%0A
+%0A%0Aclass SetupLoggingTest(TestCase):%0A    def test_basic_not_configured(self):%0A        with mock.patch('logging.getLogger', spec=logging.getLogger) as getLogger:%0A            logger = getLogger()%0A            logger.handlers = %5B%5D%0A            handler = mock.Mock()%0A            result = setup_logging(handler)%0A            self.assertTrue(result)%0A%0A    def test_basic_already_configured(self):%0A        with mock.patch('logging.getLogger', spec=logging.getLogger) as getLogger:%0A            handler = mock.Mock()%0A            logger = getLogger()%0A            logger.handlers = %5Bhandler%5D%0A            result = setup_logging(handler)%0A            self.assertFalse(result)%0A

Add basic coverage for the setup_logging method