Пример #1
0
    def test_client_Client_manuallyDisconnect_many_times_in_parallel_unique(
            self):
        testResults = TestResults(30)
        testResults.initializeList("id")

        self.help_createManySessions(testResults)

        # make sure testResults.finished() is reset (i.e. 0 again)
        testResults.clear()

        idsCopy = testResults.getListCopy("id")

        for id in idsCopy:
            thread.start_new_thread(disconnect, (self.client, id, testResults))

        t_timeout = time.time() + 10.0
        while time.time() < t_timeout and testResults.finished(
        ) < testResults.total():
            time.sleep(0.01)

        # check if no error occurred during the connection
        self.assertEqual(testResults.failed(), 0)

        # check if we now have 0 sessions
        self.assertEqual(len(self.client.allSessionInformations()), 0)

        # the ids list should also be empty:
        self.assertEqual(testResults.getListCopy("id"), [])
Пример #2
0
 def test_client_Client_manuallyDisconnect_many_times_in_parallel_unique(self):
     testResults = TestResults(30)
     testResults.initializeList("id")
     
     self.help_createManySessions(testResults)
     
     # make sure testResults.finished() is reset (i.e. 0 again)
     testResults.clear()
     
     idsCopy = testResults.getListCopy("id")
     
     for id in idsCopy:
         thread.start_new_thread(disconnect, (self.client, id, testResults))
     
     t_timeout = time.time() + 10.0
     while time.time() < t_timeout and testResults.finished() < testResults.total():
         time.sleep(0.01)
     
     # check if no error occurred during the connection
     self.assertEqual( testResults.failed() , 0 )
     
     # check if we now have 0 sessions
     self.assertEqual( len(self.client.allSessionInformations()) , 0 )
     
     
     # the ids list should also be empty:
     self.assertEqual( testResults.getListCopy("id") , [] )
Пример #3
0
 def test_client_Client_manuallyConnect_many_times_in_parallel_unique(self):
     testResults = TestResults(30)
     testResults.initializeList("id")
     
     self.help_createManySessions(testResults)
     
     # check if no error occurred during the connection
     self.assertEqual( testResults.failed() , 0 )
     
     # check if we now have sufficient unique sessions
     self.assertEqual( len(self.client.allSessionInformations()) , testResults.total() )
     
     # check if the ids list has the correct number of ids
     self.assertEqual( len(testResults.getListCopy("id")) , testResults.total() )
Пример #4
0
    def test_client_Client_manuallyConnect_many_times_in_parallel_unique(self):
        testResults = TestResults(30)
        testResults.initializeList("id")

        self.help_createManySessions(testResults)

        # check if no error occurred during the connection
        self.assertEqual(testResults.failed(), 0)

        # check if we now have sufficient unique sessions
        self.assertEqual(len(self.client.allSessionInformations()),
                         testResults.total())

        # check if the ids list has the correct number of ids
        self.assertEqual(len(testResults.getListCopy("id")),
                         testResults.total())