Code: Alles auswählen
from scrlib import *
def TestFunction( api ):
# ----------------------------------------------------------------
# Parameters that should be modified as per test environment.
# ----------------------------------------------------------------
mig25obj = api.ImportRiteScript( 'CNF-MM1-CommonFunctions' )
# ----------------------------------------------------------------
# Generic Test
# ----------------------------------------------------------------
api.SetReturnMode( RETURN_EXCEPTION )
# Exactly two devices are needed, one in MO mode; the other in MT mode.
sendDevice1 = api.RetNxtDeviceMM1( )
recvDevice1 = api.RetNxtDeviceMM1( )
# Get corresponding MSISDN numbers for the devices
msisdnS1 = api.GetMSISDN( sendDevice1 )
msisdnR1 = api.GetMSISDN( recvDevice1 )
#------------------------------------------------------------------
# 1. Submit MM from S1 to recipient R1
# Containing:
# - TO field set to R1
# - Do not give Subject field.
#------------------------------------------------------------------
msgToSend = mig25obj.CreateMsgMM1SendReq ( api, msisdnS1,\
ToAddressList = [msisdnR1], includeHeaders = \
['Subject: ' + mig25obj.normalTextSubject] )
# Add text content to the message:
sentTextContent = mig25obj.AddTextContent( msgToSend )
# Send the message through sendDevice1
mig25obj.LogSend( api, 'MM1 Send Request', 'Device S1 ('\
+ str( msisdnS1 ) + ') to Device R1 ('\
+ str( msisdnR1 ) + ')' )
api.SndMsgMM1( sendDevice1, msgToSend )
#------------------------------------------------------------------
# 2. S1 waits for Send Confirmation
# If there is no Send Confirmation, test fails
#------------------------------------------------------------------
mig25obj.LogWait( api, 'MM1 Send Confirm',\
mig25obj.wait4SendCnfTime,\
'Device S1 (' + str( msisdnS1 ) + ')' )
retCode, sendConfMsg = api.WaitForMsgMM1( sendDevice1, MM1_SEND_CNF,\
mig25obj.wait4SendCnfTime )
................
..............
...........
..........
# -----------------------------------------------------------
# End of Test
# -----------------------------------------------------------