mirror of
https://github.com/sprockets/sprockets.mixins.metrics.git
synced 2024-11-22 03:00:25 +00:00
replace list dereferencing with itertools.chain for py2
This commit is contained in:
parent
924735c24e
commit
03ba3b7125
1 changed files with 13 additions and 16 deletions
13
tests.py
13
tests.py
|
@ -1,4 +1,5 @@
|
|||
import base64
|
||||
import itertools
|
||||
import logging
|
||||
import os
|
||||
import socket
|
||||
|
@ -71,8 +72,7 @@ class TCPStatsdMetricCollectionTests(testing.AsyncHTTPTestCase):
|
|||
path = ('foo', 'bar')
|
||||
value = 500
|
||||
metric_type = 'c'
|
||||
expected = "{}:{}|{}\n".format(
|
||||
'.'.join((self.namespace, 'counters', *path)),
|
||||
expected = "{}:{}|{}\n".format('.'.join(itertools.chain((self.namespace, 'counters'), path)),
|
||||
value,
|
||||
metric_type)
|
||||
|
||||
|
@ -84,8 +84,7 @@ class TCPStatsdMetricCollectionTests(testing.AsyncHTTPTestCase):
|
|||
path = ('foo', 'bar')
|
||||
value = 500
|
||||
metric_type = 'ms'
|
||||
expected = "{}:{}|{}\n".format(
|
||||
'.'.join((self.namespace, 'timers', *path)),
|
||||
expected = "{}:{}|{}\n".format('.'.join(itertools.chain((self.namespace, 'timers'), path)),
|
||||
value,
|
||||
metric_type)
|
||||
|
||||
|
@ -213,8 +212,7 @@ class UDPStatsdMetricCollectionTests(testing.AsyncHTTPTestCase):
|
|||
path = ('foo', 'bar')
|
||||
value = 500
|
||||
metric_type = 'c'
|
||||
expected = "{}:{}|{}".format(
|
||||
'.'.join((self.namespace, 'counters', *path)),
|
||||
expected = "{}:{}|{}".format('.'.join(itertools.chain((self.namespace, 'counters'), path)),
|
||||
value,
|
||||
metric_type)
|
||||
|
||||
|
@ -228,8 +226,7 @@ class UDPStatsdMetricCollectionTests(testing.AsyncHTTPTestCase):
|
|||
path = ('foo', 'bar')
|
||||
value = 500
|
||||
metric_type = 'ms'
|
||||
expected = "{}:{}|{}".format(
|
||||
'.'.join((self.namespace, 'timers', *path)),
|
||||
expected = "{}:{}|{}".format('.'.join(itertools.chain((self.namespace, 'timers'), path)),
|
||||
value,
|
||||
metric_type)
|
||||
|
||||
|
|
Loading…
Reference in a new issue