mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
* expend checksum format to <algorithm>:(<checksum>|<url>) * continue to code at office * ALPHA - expend checksum format to <algorithm>:(<checksum>|<url>) * clean up tmpfile and comment * try to add test code for 27617 * try to add test code for 27617 * try to add test code for 27617 * try to fix [Could not find or access 'testserver.py'] * fix test code [Could not find or access 'testserver.py'] * fix test code [add files dir] * fix test code [files dir not exists] * as [connection was closed before a valid response was received] * [connection was closed before a valid response was received] * [connection was closed before a valid response was received] * add test item [sha1 and sha256] * since [connection was closed before a valid response was received] * fix [connection was closed before a valid response was received] * fix test code typo * add docs for #27617 * PR #43751 is minor change * fix pep8 issue. * fix test code style. * fix unexpected quote
This commit is contained in:
20
test/integration/targets/get_url/files/testserver.py
Normal file
20
test/integration/targets/get_url/files/testserver.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import sys
|
||||
|
||||
if __name__ == '__main__':
|
||||
if sys.version_info[0] >= 3:
|
||||
import http.server
|
||||
import socketserver
|
||||
PORT = int(sys.argv[1])
|
||||
|
||||
class Handler(http.server.SimpleHTTPRequestHandler):
|
||||
pass
|
||||
|
||||
Handler.extensions_map['.json'] = 'application/json'
|
||||
httpd = socketserver.TCPServer(("", PORT), Handler)
|
||||
httpd.serve_forever()
|
||||
else:
|
||||
import mimetypes
|
||||
mimetypes.init()
|
||||
mimetypes.add_type('application/json', '.json')
|
||||
import SimpleHTTPServer
|
||||
SimpleHTTPServer.test()
|
||||
Reference in New Issue
Block a user