diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-12-10 20:48:38 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-12-10 20:48:38 +0100 |
commit | c484268fbef4ef07455eb856d3924224c784d3e2 (patch) | |
tree | 9792966733612bd5ace2b9837ddc5bf24a00db07 /module/common/APIExerciser.py | |
parent | megaupload #451, uploadedto #443 (diff) | |
download | pyload-c484268fbef4ef07455eb856d3924224c784d3e2.tar.xz |
little test cases
Diffstat (limited to 'module/common/APIExerciser.py')
-rw-r--r-- | module/common/APIExerciser.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/module/common/APIExerciser.py b/module/common/APIExerciser.py index 7cc30c6a1..f782efa53 100644 --- a/module/common/APIExerciser.py +++ b/module/common/APIExerciser.py @@ -36,7 +36,7 @@ def startApiExerciser(core, n): class APIExerciser(Thread): - def __init__(self, core, thrift=False): + def __init__(self, core, thrift=False, user=None, pw=None): global idPool Thread.__init__(self) @@ -46,18 +46,19 @@ class APIExerciser(Thread): self.time = time() if thrift: - self.api = ThriftClient() - self.api.login("user", "pw") + self.api = ThriftClient(user=user, password=pw) else: self.api = core.api self.id = idPool - self.core.log.info("API Excerciser started %d" % self.id) + if core: + self.core.log.info("API Excerciser started %d" % self.id) + idPool += 1 - self.start() + #self.start() def run(self): out = open("error.log", "ab") @@ -150,4 +151,7 @@ class APIExerciser(Thread): self.api.getPackageData(choice(info).pid) def getAccounts(self): - self.api.getAccounts(False)
\ No newline at end of file + self.api.getAccounts(False) + + def getCaptchaTask(self): + self.api.getCaptchaTask(False)
\ No newline at end of file |