mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
add requests class to sow the seeds of a custom matcher
This commit is contained in:
18
vcr/request.py
Normal file
18
vcr/request.py
Normal file
@@ -0,0 +1,18 @@
|
||||
class Request(object):
|
||||
|
||||
def __init__(self, host, port, method, url, body, headers):
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.method = method
|
||||
self.url = url
|
||||
self.body = body
|
||||
self.headers = frozenset(headers.items())
|
||||
|
||||
def __key(self):
|
||||
return (self.host, self.port, self.method, self.url, self.body, self.headers)
|
||||
|
||||
def __hash__(self):
|
||||
return hash(self.__key())
|
||||
|
||||
def __eq__(self, other):
|
||||
return hash(self) == hash(other)
|
||||
Reference in New Issue
Block a user