From 7e7adc64713f74976d5994af36b5f758620fb37b Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 13 Oct 2012 21:39:58 +0200 Subject: added JSON and WS client, re organized tests, new classes for easier api tests --- tests/other/test_syntax.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/other/test_syntax.py (limited to 'tests/other/test_syntax.py') diff --git a/tests/other/test_syntax.py b/tests/other/test_syntax.py new file mode 100644 index 000000000..fbf7edf8f --- /dev/null +++ b/tests/other/test_syntax.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +from os import walk +from os.path import abspath, dirname, join + +from unittest import TestCase + +PATH = abspath(join(dirname(abspath(__file__)), "..", "..", "")) + +# needed to register globals +from tests.helper import Stubs + +class TestSyntax(TestCase): + pass + + +for path, dirs, files in walk(join(PATH, "module")): + + for f in files: + if not f.endswith(".py") or f.startswith("__"): continue + fpath = join(path, f) + pack = fpath.replace(PATH, "")[1:-3] #replace / and .py + imp = pack.replace("/", ".") + packages = imp.split(".") + #__import__(imp) + + # to much sideeffect when importing + if "web" in packages or "lib" in packages: continue + if "ThriftTest" in packages: continue + + # currying + def meta(imp, sig): + def _test(self=None): + __import__(imp) + + _test.func_name = sig + return _test + + # generate test methods + sig = "test_%s_%s" % (packages[-2], packages[-1]) + + + setattr(TestSyntax, sig, meta(imp, sig)) \ No newline at end of file -- cgit v1.2.3