Import the threading
module and run SudsMove()
like so:
threading.Thread(target = SudsMove).start()
That will create and start a background thread which does the movement.
ANSWER TO EDITED QUESTION:
As far as I understand this, TestAbsoluteMove.Ssh(self)
polls the speed once and stores the result in self.Value
?! And you're testing the expected end tilt/rotation/position with self.assertEqual(self.Value, '3500')
?!
If that's correct, you should wait for the camera to start its movement. You could probably poll the speed in a certain interval:
# Move camera in background thread
threading.Thread(target = SudsMove).start()
# What does this do?
self.command = './ptzpanposition -c 0 -u degx10'
# Poll the current speed in an interval of 250 ms
import time
measuredSpeedsList = []
for i in xrange(20):
# Assuming that this call will put the result in self.Value
TestAbsoluteMove.Ssh(self)
measuredSpeedsList.append(self.Value)
time.sleep(0.25)
print "Measured movement speeds: ", measuredSpeedsList
The movement speed will be the biggest value in measuredSpeedsList
(i.e. max(measuredSpeedsList)
). Hope that makes sense...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…