Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Make sure lint runs in Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuri Shkuro committed May 21, 2016
1 parent 60416c5 commit 160991f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ install:
- make bootstrap

script:
- make test
- make test lint

2 changes: 1 addition & 1 deletion opentracing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from __future__ import absolute_import
from .span import Span # noqa
from .span import start_child_span # noqa
from .span import canonicalize_baggage_key #noqa
from .span import canonicalize_baggage_key # noqa
from .tracer import Tracer # noqa
from .propagation import Format # noqa
from .propagation import InvalidCarrierException # noqa
Expand Down
7 changes: 3 additions & 4 deletions opentracing/ext/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
SPAN_KIND_RPC_SERVER = 'server'

# ---------------------------------------------------------------------------
# COMPONENT (string) ia s low-cardinality identifier of the module, library,
# COMPONENT (string) ia s low-cardinality identifier of the module, library,
# or package that is generating a span.
# ---------------------------------------------------------------------------
COMPONENT = 'component'
Expand Down Expand Up @@ -71,15 +71,14 @@
# HTTP tags
# ---------------------------------------------------------------------------

# HTTP_URL string) should be the URL of the request being handled in this
# HTTP_URL (string) should be the URL of the request being handled in this
# segment of the trace, in standard URI format. The protocol is optional.
HTTP_URL = 'http.url'

# HTTP_METHOD (string) is the HTTP method of the request.
# Both upper/lower case values are allowed.
HTTP_METHOD = 'http.method'

# HTTP_STATUS_CODE (int) is the numeric HTTP status code (200, 404, etc)
# HTTP_STATUS_CODE (int) is the numeric HTTP status code (200, 404, etc)
# of the HTTP response.
HTTP_STATUS_CODE = 'http.status_code'

2 changes: 1 addition & 1 deletion opentracing/propagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Format:
# NOTE: Since HTTP headers are a particularly important use case for the
# TEXT_MAP carrier, dict key parameters identify their respective values in
# a case-insensitive manner.
#
#
# NOTE: The TEXT_MAP carrier dict may contain unrelated data (e.g.,
# arbitrary HTTP headers). As such, the Tracer implementation should use a
# prefix or other convention to distinguish Tracer-specific key:value
Expand Down
2 changes: 2 additions & 0 deletions opentracing/span.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import re


class Span(object):
"""
Span represents a unit of work executed on behalf of a trace. Examples of
Expand Down Expand Up @@ -204,6 +205,7 @@ def start_child_span(parent_span, operation_name, tags=None, start_time=None):

_baggage_key_re = re.compile('^(?i)([a-z0-9][-a-z0-9]*)$')


def canonicalize_baggage_key(key):
"""canonicalize_baggage_key returns a canonicalized key if it's valid.
Expand Down
11 changes: 6 additions & 5 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
from __future__ import absolute_import
from opentracing import canonicalize_baggage_key


def test_canonicalize_baggage_key():
badKey = "some-weird-sign!#"
assert canonicalize_baggage_key(badKey) == None
badKey = 'some-weird-sign!#'
assert canonicalize_baggage_key(badKey) is None

badKey2 = "-another-sign"
assert canonicalize_baggage_key(badKey2) == None
badKey2 = '-another-sign'
assert canonicalize_baggage_key(badKey2) is None

goodKey = "000-Capitalized-9"
goodKey = '000-Capitalized-9'
canonicalKey = canonicalize_baggage_key(goodKey)
assert canonicalKey == goodKey.lower()

0 comments on commit 160991f

Please sign in to comment.