merge of #2693 re-write connections/http.py to be unittest based