def digest_parts(self, headers): auth = headers.get('Authorization') or headers.get('authorization') if not auth: return None auth = from_list(auth).strip('Digest ') excludes = ('cnonce', 'response') return [p for p in auth.split(', ') if not p.startswith(excludes)]
def digest_parts(self, headers): auth = headers.get('Authorization') or headers.get('authorization') if not auth: return None auth = from_list(auth).strip('Digest ') # cnonce and response will be based on the system time, which I will # not monkey-patch. excludes = ('cnonce', 'response') return [p for p in auth.split(', ') if not p.startswith(excludes)]
def test_from_list_handles_non_lists(self): a = 'value' assert util.from_list(a) == 'value'
def test_from_list_returns_an_element(self): a = ['value'] assert util.from_list(a) == 'value'
def flatten_headers(self, request): from betamax.cassette.util import from_list headers = request['headers'].items() return dict((k, from_list(v)) for (k, v) in headers)
def test_from_list_returns_an_element(self): a = ["value"] assert util.from_list(a) == "value"