From 906bb7c1ecc5c34aa93148894eef763f27eba98e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 12 May 2015 12:22:20 +0200 Subject: Other import fixes --- tests/APIExerciser.py | 7 +++---- tests/test_api.py | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'tests') 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() -- cgit v1.2.3