def _invocation_to_s(self, *args, **kwargs): """ Convert a function invocation into a pretty printable string. """ return "({})".format(", ".join( compact([self._args_to_s(*args), self._kwargs_to_s(**kwargs)])))
def _invocation_to_s(self, *args, **kwargs): """ Convert a function invocation into a pretty printable string. """ return u'({})'.format( ', '.join(compact([ self._args_to_s(*args), self._kwargs_to_s(**kwargs), ])) )
def _default_logging(self): from sentry.app import env if (not env.request or not hasattr(env.request, "resolver_match") or not hasattr(env.request.resolver_match, "kwargs")): return {} request_params = env.request.resolver_match.kwargs return compact({ "org": request_params.get("organization_slug"), "team": request_params.get("team_slug"), "project": request_params.get("project_slug"), })
def _default_logging(self): from sentry.app import env if not env.request or \ not hasattr(env.request, 'resolver_match') or \ not hasattr(env.request.resolver_match, 'kwargs'): return {} request_params = env.request.resolver_match.kwargs return compact({ 'org': request_params.get('organization_slug'), 'team': request_params.get('team_slug'), 'project': request_params.get('project_slug'), })
def test_none(self): assert compact({"foo": None, "bar": 1}) == {"bar": 1}
def test_empty_string(self): assert compact({"foo": ""}) == {"foo": ""}
def test_false(self): assert compact({"foo": False}) == {"foo": False}
def test_zero(self): assert compact({"foo": 0}) == {"foo": 0}
def test_none(self): assert compact({'foo': None, 'bar': 1}) == {'bar': 1}
def test_empty_string(self): assert compact({'foo': ''}) == {'foo': ''}
def test_false(self): assert compact({'foo': False}) == {'foo': False}
def test_zero(self): assert compact({'foo': 0}) == {'foo': 0}