mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
Make defaults of Cassette constructor immutable. Clean up whitespace. Remove unused import.
This commit is contained in:
@@ -30,12 +30,12 @@ class Cassette(ContextDecorator):
|
||||
path,
|
||||
serializer=yamlserializer,
|
||||
record_mode='once',
|
||||
match_on=[uri, method],
|
||||
filter_headers=[],
|
||||
filter_query_parameters=[],
|
||||
match_on=(uri, method),
|
||||
filter_headers=(),
|
||||
filter_query_parameters=(),
|
||||
before_record=None,
|
||||
ignore_hosts=[],
|
||||
ignore_localhost=[],
|
||||
ignore_hosts=(),
|
||||
ignore_localhost=()
|
||||
):
|
||||
self._path = path
|
||||
self._serializer = serializer
|
||||
|
||||
@@ -26,7 +26,7 @@ class Counter(dict):
|
||||
>>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping
|
||||
>>> c = Counter(a=4, b=2) # a new counter from keyword args
|
||||
|
||||
'''
|
||||
'''
|
||||
self.update(iterable, **kwds)
|
||||
|
||||
def __missing__(self, key):
|
||||
@@ -39,7 +39,7 @@ class Counter(dict):
|
||||
>>> Counter('abracadabra').most_common(3)
|
||||
[('a', 5), ('r', 2), ('b', 2)]
|
||||
|
||||
'''
|
||||
'''
|
||||
if n is None:
|
||||
return sorted(self.iteritems(), key=itemgetter(1), reverse=True)
|
||||
return nlargest(n, self.iteritems(), key=itemgetter(1))
|
||||
@@ -78,7 +78,7 @@ class Counter(dict):
|
||||
>>> c['h'] # four 'h' in which, witch, and watch
|
||||
4
|
||||
|
||||
'''
|
||||
'''
|
||||
if iterable is not None:
|
||||
if hasattr(iterable, 'iteritems'):
|
||||
if self:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import tempfile
|
||||
import os
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user