From 692d015627ecf03fbc23cfdb4afcf398b9a09a51 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 12 Jan 2012 17:26:28 +0100 Subject: scripts for testing and syntax unit test --- tests/test_api.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'tests/test_api.py') diff --git a/tests/test_api.py b/tests/test_api.py index f8901f731..76b3e1b40 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -7,14 +7,12 @@ from nose.tools import nottest class TestApi: def __init__(self): - self.api = APIExerciser.APIExerciser(None, True, "TestUser", "pwhere") + self.api = APIExerciser.APIExerciser(None, True, "TestUser", "sometestpw") def test_login(self): assert self.api.api.login("crapp", "wrong pw") is False - #takes really long, only test when needed - @nottest + #@nottest def test_random(self): - - for i in range(0, 100): + for i in range(0, 1000): self.api.testAPI() -- cgit v1.2.3 From 26227cfe53f8fd4bc1631d8e1b35031f589682dc Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 15 Jan 2012 15:55:19 +0100 Subject: backend + api test case, nicer format for plugin tester --- tests/test_api.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tests/test_api.py') diff --git a/tests/test_api.py b/tests/test_api.py index 76b3e1b40..236f72882 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,18 +1,18 @@ -# -*- coding: utf-8 -*- -from module.common import APIExerciser -from nose.tools import nottest +from unittest import TestCase +from pyLoadCore import Core +from module.common.APIExerciser import APIExerciser -class TestApi: +class TestApi(TestCase): - def __init__(self): - self.api = APIExerciser.APIExerciser(None, True, "TestUser", "sometestpw") + @classmethod + def setUpClass(cls): + cls.core = Core() + cls.core.start(False, False, True) - def test_login(self): - assert self.api.api.login("crapp", "wrong pw") is False - - #@nottest def test_random(self): - for i in range(0, 1000): - self.api.testAPI() + api = APIExerciser(self.core) + + for i in range(2000): + api.testAPI() \ No newline at end of file -- cgit v1.2.3 From 247ae6fbec98dbc42c3910df2942842ef5256715 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 15 Jan 2012 21:17:23 +0100 Subject: fix test cases --- tests/test_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_api.py') diff --git a/tests/test_api.py b/tests/test_api.py index 236f72882..0171b46bb 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -15,4 +15,4 @@ class TestApi(TestCase): api = APIExerciser(self.core) for i in range(2000): - api.testAPI() \ No newline at end of file + api.testAPI() -- cgit v1.2.3