summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/APIExerciser.py11
-rw-r--r--tests/test_api.py2
2 files changed, 9 insertions, 4 deletions
diff --git a/tests/APIExerciser.py b/tests/APIExerciser.py
index 32a3304c0..d17f81ae2 100644
--- a/tests/APIExerciser.py
+++ b/tests/APIExerciser.py
@@ -32,11 +32,12 @@ sumCalled = 0
def startApiExerciser(core, n):
- for _ in range(n):
+ for _i in range(n):
APIExerciser(core).start()
class APIExerciser(Thread):
+
def __init__(self, core, thrift=False, user=None, pw=None):
global idPool
@@ -114,9 +115,11 @@ class APIExerciser(Thread):
self.api.addPackage(name, urls, choice([Destination.Queue, Destination.Collector]))
+
def deleteFiles(self):
info = self.api.getQueueData()
- if not info: return
+ if not info:
+ return
pack = choice(info)
fids = pack.links
@@ -125,9 +128,11 @@ class APIExerciser(Thread):
fids = [f.fid for f in sample(fids, randint(1, max(len(fids) / 2, 1)))]
self.api.deleteFiles(fids)
+
def deletePackages(self):
info = choice([self.api.getQueue(), self.api.getCollector()])
- if not info: return
+ if not info:
+ return
pids = [p.pid for p in info]
if pids:
diff --git a/tests/test_api.py b/tests/test_api.py
index 9c12da51c..13e783d54 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -20,5 +20,5 @@ class TestApi(object):
@nottest
def test_random(self):
- for _ in range(0, 100):
+ for _i in range(0, 100):
self.api.testAPI()