summaryrefslogtreecommitdiffstats
path: root/For Weekly Test/tricode/testingfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'For Weekly Test/tricode/testingfile.py')
-rw-r--r--For Weekly Test/tricode/testingfile.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/For Weekly Test/tricode/testingfile.py b/For Weekly Test/tricode/testingfile.py
new file mode 100644
index 0000000..f7f3f05
--- /dev/null
+++ b/For Weekly Test/tricode/testingfile.py
@@ -0,0 +1,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