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

Commit

Permalink
fixing a test case, I moved a function from a module to an other.
Browse files Browse the repository at this point in the history
do not create the sentry handler if the user does not want it.
  • Loading branch information
mfrasca committed Dec 30, 2015
1 parent 5cd4e60 commit e1d3210
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions bauble/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,19 +239,19 @@ def main(uri=None):
# no raven.conf.setup_logging: just standard Python logging
from raven import Client
from raven.handlers.logging import SentryHandler
sentry_client = Client('https://59105d22a4ad49158796088c26bf8e4c:'
'00268114ed47460b94ce2b1b0b2a4a20@'
'app.getsentry.com/45704')
handler = SentryHandler(sentry_client)

# only register the sentry client if the user agrees on it
if prefs[use_sentry_client_pref]:
logger.debug('registering sentry client')
sentry_client = Client('https://59105d22a4ad49158796088c26bf8e4c:'
'00268114ed47460b94ce2b1b0b2a4a20@'
'app.getsentry.com/45704')
handler = SentryHandler(sentry_client)
logging.getLogger().addHandler(handler)
handler.setLevel(logging.WARNING)
else:
logger.debug('not registering sentry client')

handler.setLevel(logging.WARNING)
except Exception, e:
logger.warning("can't configure sentry client")
logger.debug('%s - %s' % (type(e), e))
Expand Down
5 changes: 3 additions & 2 deletions bauble/test/test_bauble.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from sqlalchemy import (
Column, Integer)

import unittest
import bauble
import bauble.db as db
from bauble.btypes import Enum, EnumError
Expand Down Expand Up @@ -291,10 +292,10 @@ def on_tag_desc_textbuffer_changed(self, *args):
presenter.on_tag_desc_textbuffer_changed() # avoid uncounted line!


class GlobalFunctionsTests(BaubleTestCase):
class GlobalFunctionsTests(unittest.TestCase):
def test_newer_version_on_github(self):
import StringIO
from bauble import newer_version_on_github
from bauble.connmgr import newer_version_on_github
stream = StringIO.StringIO('version = "1.0.0" # comment')
self.assertFalse(newer_version_on_github(stream) and True or False)
stream = StringIO.StringIO('version = "1.0.99999" # comment')
Expand Down

0 comments on commit e1d3210

Please sign in to comment.