diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-12 12:22:20 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-12 12:22:20 +0200 |
commit | 906bb7c1ecc5c34aa93148894eef763f27eba98e (patch) | |
tree | 2f09a639cdd9e414e8f165a667c71a837288d4de /tests | |
parent | Revert damaged logo.png (diff) | |
download | pyload-906bb7c1ecc5c34aa93148894eef763f27eba98e.tar.xz |
Other import fixes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/APIExerciser.py | 7 | ||||
-rw-r--r-- | tests/test_api.py | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/tests/APIExerciser.py b/tests/APIExerciser.py index 02bfef20d..d2a069c78 100644 --- a/tests/APIExerciser.py +++ b/tests/APIExerciser.py @@ -4,14 +4,13 @@ from __future__ import with_statement import gc +import math import random import string import threading import time import traceback -from math import floor - from pyload.remote.thriftbackend.ThriftClient import ThriftClient, Destination @@ -116,7 +115,7 @@ class APIExerciser(threading.Thread): name = "".join(random.sample(string.ascii_letters, 10)) urls = createURLs() - self.api.addPackage(name, urls, random.choice([Destination.Queue, Destination.Collector])) + self.api.addPackage(name, urls, random.choice([Destination.Queue.Queue, Destination.Collector])) def deleteFiles(self): @@ -139,7 +138,7 @@ class APIExerciser(threading.Thread): pids = [p.pid for p in info] if pids: - pids = random.sample(pids, random.randint(1, max(floor(len(pids) / 2.5), 1))) + pids = random.sample(pids, random.randint(1, max(math.floor(len(pids) / 2.5), 1))) self.api.deletePackages(pids) diff --git a/tests/test_api.py b/tests/test_api.py index 1e02d8aa3..ca02f7a2c 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,9 +1,9 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -import APIExerciser +import nose -from nose.tools import nottest +import APIExerciser class TestApi(object): @@ -18,7 +18,7 @@ class TestApi(object): # takes really long, only test when needed - @nottest + @nose.tools.nottest def test_random(self): for _i in xrange(0, 100): self.api.testAPI() |