コード例 #1
0
 def test_should_create_out_file(self):
     mitm.run_mitmdump(mitmcfg.outfile, 2)  # call without a port number
     sleep(1)  # give some to mitmdump
     self.assert_is_file(
         mitmcfg.dmpfile,
         "Output file %s is missing, cannot start mitmdump with default port"
         % mitmcfg.dmpfile)
コード例 #2
0
 def test_should_run_process_async(self):
     start = time()
     mitm.run_mitmdump(mitmcfg.outfile,
                       60)  # call with a long timeout, 60sec
     time_passed = time() - start
     self.assertLess(time_passed, mitm.PORT_TRY_TIMEOUT + TIME_TOLERANCE,
                     "mitmdump didn't return immediately %s " % time_passed)
コード例 #3
0
ファイル: mitm_test.py プロジェクト: abhiraw/fpdetective
 def test_should_run_multiple_instances_together(self):
     for i in xrange(5): # run 50 mitmdump instances together 
         i += 1
         sleep(0.2)
         try:
             mitm.run_mitmdump(mitmcfg.outfile, 5) # call with a long timeout, 60sec
         except:
             self.fail("Cannot start %s mitmdump process in parallel" % i)
コード例 #4
0
 def test_should_run_multiple_instances_together(self):
     for i in xrange(5):  # run 50 mitmdump instances together
         i += 1
         sleep(0.2)
         try:
             mitm.run_mitmdump(mitmcfg.outfile,
                               5)  # call with a long timeout, 60sec
         except:
             self.fail("Cannot start %s mitmdump process in parallel" % i)
コード例 #5
0
 def test_should_return_port_pid(self):
     port, pid = mitm.run_mitmdump(mitmcfg.outfile,
                                   2)  # call with a port number
     self.assert_port_and_pid_is_ok(
         port, pid, "cannot start mitmdump with default port")
コード例 #6
0
ファイル: mitm_test.py プロジェクト: abhiraw/fpdetective
 def test_should_run_process_async(self):
     start = time()
     mitm.run_mitmdump(mitmcfg.outfile, 60) # call with a long timeout, 60sec
     time_passed = time() - start
     self.assertLess(time_passed, mitm.PORT_TRY_TIMEOUT+TIME_TOLERANCE, "mitmdump didn't return immediately %s " % time_passed)
コード例 #7
0
ファイル: mitm_test.py プロジェクト: abhiraw/fpdetective
 def test_should_create_out_file(self):
     mitm.run_mitmdump(mitmcfg.outfile, 2) # call without a port number
     sleep(1) # give some to mitmdump
     self.assert_is_file(mitmcfg.dmpfile, "Output file %s is missing, cannot start mitmdump with default port" % mitmcfg.dmpfile)
コード例 #8
0
ファイル: mitm_test.py プロジェクト: abhiraw/fpdetective
 def test_should_return_port_pid(self):
     port, pid = mitm.run_mitmdump(mitmcfg.outfile, 2) # call with a port number
     self.assert_port_and_pid_is_ok(port, pid, "cannot start mitmdump with default port")