Hello,
I am calling a function several times as I am testing several responses. I am asking on how I call a function earlier in the program, changing a variable in this function and then calling it. Below is a snippet of the code.
class AbsoluteMove(unittest.TestCase):
def Ssh(self):
p=pexpect.spawn('ssh [email protected]')
self.command = './ptzpanposition -c 0 -u degx10'
p.sendline("cd /bin")
i=p.expect('user@user-NA:')
p.sendline(self.command)
i=p.expect('user@-userNA:')
self.Value = p.before
class VerifyTilt(AbsoluteMove):
def runTest(self):
self.dest.PanTilt._y=2.0
try:
result = self.client.service.AbsoluteMove(self.token, self.dest, self.speed)
except suds.WebFault as detail:
print detail
self.command = './ptzpanposition -c 0 -u degx10'
AbsoluteMove.Ssh(self)
# Position of the camera verified through Ssh (No decimal point added to the Ssh value)
self.assertEqual(self.Value, '20')
I want to change the 'self.command' variable in AbsoluteMove.Ssh() and then run this function. Does anyone know how to do this?
Thanks for any help