MCPcopy Index your code
hub / github.com/pyload/pyload / testAPI

Method testAPI

module/common/APIExerciser.py:93–111  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

91 #sleep(random() / 500)
92
93 def testAPI(self):
94 global sumCalled
95
96 m = ["statusDownloads", "statusServer", "addPackage", "getPackageData", "getFileData", "deleteFiles",
97 "deletePackages", "getQueue", "getCollector", "getQueueData", "getCollectorData", "isCaptchaWaiting",
98 "getCaptchaTask", "stopAllDownloads", "getAllInfo", "getServices" , "getAccounts", "getAllUserData"]
99
100 method = choice(m)
101 #print "Testing:", method
102
103 if hasattr(self, method):
104 res = getattr(self, method)()
105 else:
106 res = getattr(self.api, method)()
107
108 self.count += 1
109 sumCalled += 1
110
111 #print res
112
113 def addPackage(self):
114 name = "".join(sample(string.ascii_letters, 10))

Callers 2

runMethod · 0.95
test_randomMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_randomMethod · 0.64