Mock HTTPConnection instead of urlopen
Fix HTTPS connection and redirect