From 004a80bfaad38f9400e8aebcb8f980353a232295 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 1 Dec 2014 23:53:07 +0100 Subject: PEP-8, Python Zen, refactor and reduce code (thx FedeG) --- tests/test_api.py | 8 +++----- tests/test_json.py | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/test_api.py b/tests/test_api.py index a4229cfe6..213e13de2 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -5,17 +5,15 @@ import APIExerciser from nose.tools import nottest -class TestApi: - +class TestApi(object): def __init__(self): self.api = APIExerciser.APIExerciser(None, True, "TestUser", "pwhere") def test_login(self): assert self.api.api.login("crapp", "wrong pw") is False - #takes really long, only test when needed + # takes really long, only test when needed @nottest def test_random(self): - - for i in range(0, 100): + for _ in range(0, 100): self.api.testAPI() diff --git a/tests/test_json.py b/tests/test_json.py index 320a42d4f..7141d2a80 100644 --- a/tests/test_json.py +++ b/tests/test_json.py @@ -8,8 +8,8 @@ from logging import log url = "http://localhost:8001/api/%s" -class TestJson: +class TestJson(object): def call(self, name, post=None): if not post: post = {} post["session"] = self.key -- cgit v1.2.3