def testStartTimesout(self):
   webserverRunner = TestWebserver(".", 8899)
   webserverRunner.startServing()
   before = datetime.datetime.now()
   webserverRunner.startTest(3)
   webserverRunner.testResults()
   after = datetime.datetime.now()
   self.assertTrue(((after - before).seconds) >= 3)
   webserverRunner.shutdown()
 def testStartinWebserverUpdatesState(self):
   webserverRunner = TestWebserver(".", 8899)
   webserverRunner.startServing()
   webserverRunner.startTest(1)
   self.assertTrue(webserverRunner.test_instance_is_running)
   self.assertFalse(webserverRunner.test_completion_lock.isSet())
   # TODO: assert on value using some thread syncronization mechanism
   # self.assertTrue(webserverRunner.running) 
   webserverRunner.testResults()
   webserverRunner.shutdown()    
Beispiel #3
0
 def testStartTimesout(self):
     webserverRunner = TestWebserver(".", 8899)
     webserverRunner.startServing()
     before = datetime.datetime.now()
     webserverRunner.startTest(3)
     webserverRunner.testResults()
     after = datetime.datetime.now()
     self.assertTrue(((after - before).seconds) >= 3)
     webserverRunner.shutdown()
Beispiel #4
0
 def testStartinWebserverUpdatesState(self):
     webserverRunner = TestWebserver(".", 8899)
     webserverRunner.startServing()
     webserverRunner.startTest(1)
     self.assertTrue(webserverRunner.test_instance_is_running)
     self.assertFalse(webserverRunner.test_completion_lock.isSet())
     # TODO: assert on value using some thread syncronization mechanism
     # self.assertTrue(webserverRunner.running)
     webserverRunner.testResults()
     webserverRunner.shutdown()
 def testNotifyOnDoPostProcessesRightUrl(self):
   webserverRunner = TestWebserver(".", 8899)
   webserverRunner.test_instance_is_running = True
   webserverRunner.test_completion_lock.clear()
   
   webserverRunner.notifyOnDoPost('{"foo": "bar"}', "some url")
   self.assertEqual('', webserverRunner.json_test_result)
   self.assertFalse(webserverRunner.test_completion_lock.isSet())
   
   webserverRunner.notifyOnDoPost('{"foo": "bar"}', 
                                  TestWebserver.RESULTS_POSTBACK_FILE_PATTERN)
   self.assertEqual({'foo': 'bar'}, webserverRunner.json_test_result)
   self.assertTrue(webserverRunner.test_completion_lock.isSet())
   webserverRunner.shutdown()
Beispiel #6
0
    def testNotifyOnDoPostProcessesRightUrl(self):
        webserverRunner = TestWebserver(".", 8899)
        webserverRunner.test_instance_is_running = True
        webserverRunner.test_completion_lock.clear()

        webserverRunner.notifyOnDoPost('{"foo": "bar"}', "some url")
        self.assertEqual("", webserverRunner.json_test_result)
        self.assertFalse(webserverRunner.test_completion_lock.isSet())

        webserverRunner.notifyOnDoPost('{"foo": "bar"}', TestWebserver.RESULTS_POSTBACK_FILE_PATTERN)
        self.assertEqual({"foo": "bar"}, webserverRunner.json_test_result)
        self.assertTrue(webserverRunner.test_completion_lock.isSet())
        webserverRunner.shutdown()
Beispiel #7
0
 def testInitialization(self):
     webserverRunner = TestWebserver(".", 8899)
     self.assertFalse(webserverRunner.test_instance_is_running)
     self.assertFalse(webserverRunner.test_completion_lock.isSet())
     self.assertFalse(webserverRunner.running)
     webserverRunner.shutdown()
Beispiel #8
0
 def testStartAndShutdown(self):
     webserverRunner = TestWebserver(".", 8899)
     webserverRunner.startServing()
     webserverRunner.startTest(1)
     webserverRunner.testResults()
     webserverRunner.startTest(1)
     webserverRunner.testResults()
     webserverRunner.shutdown()
 def testInitialization(self):
   webserverRunner = TestWebserver(".", 8899)
   self.assertFalse(webserverRunner.test_instance_is_running)
   self.assertFalse(webserverRunner.test_completion_lock.isSet())
   self.assertFalse(webserverRunner.running)
   webserverRunner.shutdown()
 def testStartAndShutdown(self):
   webserverRunner = TestWebserver(".", 8899)
   webserverRunner.startServing()
   webserverRunner.startTest(1)
   webserverRunner.testResults()
   webserverRunner.startTest(1)
   webserverRunner.testResults()
   webserverRunner.shutdown()