Beispiel #1
0
 def test_curl_ssl(self):
     proc = Process(encoding='utf-8')
     proc.spawn([sys.executable, 'curl.py', 'https://xkcd.org'], stdout=PIPE)
     stdout, stderr = proc.communicate(timeout=30)
     self.assertEqual(proc.returncode, 0)
     self.assertTrue('<html' in stdout)
     proc.close()
Beispiel #2
0
 def test_curl(self):
     proc = Process(encoding='utf-8')
     proc.spawn([sys.executable, 'curl.py', 'http://www.python.org'],
                stdout=PIPE)
     stdout, stderr = proc.communicate(timeout=30)
     self.assertEqual(proc.returncode, 0)
     self.assertEqual(stdout, '')
     proc.close()