summaryrefslogtreecommitdiffstats
path: root/For Weekly Test/tricode/testingfile.py
blob: f7f3f0591ea93d58227a7af15caddde5ef9dddf9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

nanoBts = list()
lists = [['sip', 'GSMExt.o2',200],['sip', 'GSMExt.Tm',200],['sip', 'GSMExt.Eplus',486],['sip', 'GSMExt.Voda',200],['GSMExt.o2','sip',200],['GSMExt.Voda','sip',200],['GSMExt.Eplus','sip',486],['GSMExt.Tm','sip',486]]
def test():
	for x in lists:
            	call=x[0]
           	dest=x[1]
        	result=x[2]
		#print x
		if call[0:5]=='GSMEx': # looking for calling from GSMexternal
            		found = False
            		if len(nanoBts) == 0:
                		nanoBts.append([call, result])
                		found = False
            		else:
				delete = False
                		for y in nanoBts: #find the existing result for GSM external in the list
                    			name = y[0]
                    			if name == call:
						if int(y[1]) == 486:
							delete = True
							nanoBts.remove(y)
						else:
                        				found = True

                		if found != True:
                    			nanoBts.append([call, result])
            	if dest[0:5]=='GSMEx': # looking for destination call to GSMexternal
            		found = False
            		if len(nanoBts) == 0:
                		nanoBts.append([dest,result])
                		found = False
            		else:
				delete = False
                		for y in nanoBts:
                    			name = y[0]
                    			if name == dest:
						if int(y[1]) == 486:
							delete = True
							item = y
							nanoBts.remove(y)
						else:
                        				found = True
                		if found != True:
                    			nanoBts.append([dest,result])
		#print nanoBts

test()
print nanoBts