From d0da9edc14155fcac8a01d214badb01915e6dcec Mon Sep 17 00:00:00 2001 From: Jean-Marc Martins Date: Thu, 5 Sep 2013 15:36:41 +0200 Subject: [PATCH] Adds base tests for storage configs --- tests/test_base.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/tests/test_base.py b/tests/test_base.py index 54f73dc..542441b 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -81,23 +81,10 @@ class BaseRequests(object): status, headers, answer = self.request("GET", "/calendar.ics/") assert u"VEVENT" not in answer - -def test_generator(): - """Generates tests for all the system classes""" - cl_list = [FileSystem, MultiFileSystem, DataBaseSystem, - GitFileSystem, GitMultiFileSystem] - for cl in cl_list: - classname = "Test%s" % cl.__name__ - generated_class = type(classname, (BaseRequests,), {}) - yield generated_class() - # Generates Classes with different configs cl_list = [FileSystem, MultiFileSystem, DataBaseSystem, GitFileSystem, GitMultiFileSystem] for cl in cl_list: classname = "Test%s" % cl.__name__ - - class DummyClass(BaseRequests, cl): - """Test for %s""" % cl.__name__ - DummyClass.__name__ = classname - setattr(sys.modules[__name__], classname, DummyClass) + setattr(sys.modules[__name__], + classname, type(classname, (BaseRequests, cl), {}))