-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Hey @cyprieng, think this a great library, but would love to see aiohttp support at some point.
I've had a brief look at this and wonder if swapping out httpretty for the mocket httpretty compatibility layer would be a suitable way to do it? I think the compatibility layer could work here and provide the asyncio support required.
swagger-stub/swagger_stub/swagger_stub.py
Lines 223 to 256 in 5d8444a
httpretty.enable() | |
for i in swagger_files_url: # Get all given swagger files and url | |
base_url = i[1] | |
s = SwaggerParser(i[0]) | |
swagger_url[base_url] = s | |
# Register all urls | |
httpretty.register_uri( | |
httpretty.GET, re.compile(base_url + r'/.*'), | |
body=get_data_from_request) | |
httpretty.register_uri( | |
httpretty.POST, re.compile(base_url + r'/.*'), | |
body=get_data_from_request) | |
httpretty.register_uri( | |
httpretty.PUT, re.compile(base_url + r'/.*'), | |
body=get_data_from_request) | |
httpretty.register_uri( | |
httpretty.PATCH, re.compile(base_url + r'/.*'), | |
body=get_data_from_request) | |
httpretty.register_uri( | |
httpretty.DELETE, re.compile(base_url + r'/.*'), | |
body=get_data_from_request) | |
memory[base_url] = StubMemory(s) | |
yield memory[base_url] | |
# Close httpretty | |
httpretty.disable() | |
httpretty.reset() |
Metadata
Metadata
Assignees
Labels
No labels