[conduit: 9/138] Checkpoint



commit 864857f879230c13df42cbcdb9d583f5d523f120
Author: John Carr <john carr unrouted co uk>
Date:   Sun Apr 19 14:33:57 2009 -0700

    Checkpoint
---
 test/soup/__init__.py             |    2 +-
 test/soup/test_dataprovider.py    |   24 ++++++++++++++----------
 test/soup/test_synchronization.py |    2 +-
 3 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/test/soup/__init__.py b/test/soup/__init__.py
index c66bb2f..041acfd 100644
--- a/test/soup/__init__.py
+++ b/test/soup/__init__.py
@@ -5,7 +5,7 @@ CHANGE_ADD = 1
 CHANGE_REPLACE = 2
 CHANGE_DELETE = 3
 
-class BaseTest(unittest.TestCase):
+class TestCase(unittest.TestCase):
 
     def grumpy(self):
         #Set up our own mapping DB so we dont pollute the global one
diff --git a/test/soup/test_dataprovider.py b/test/soup/test_dataprovider.py
index 8497432..d4cfae2 100644
--- a/test/soup/test_dataprovider.py
+++ b/test/soup/test_dataprovider.py
@@ -2,10 +2,10 @@ import unittest
 
 import soup
 
-class DataproviderTest(soup.BaseTest):
+class DataproviderTest(soup.TestCase):
 
     def test_add(self):
-        pass
+        assert self.dataprovider != None
 
     def test_replace(self):
         pass
@@ -22,14 +22,18 @@ class DataproviderTest(soup.BaseTest):
     def test_get_num_items(self):
         pass
 
-class TestDataproviders(unittest.TestSuite):
-
-    def __init__(self, tests=None):
-        tests = []
-        for mod in soup.modules.all():
-            tests.append(TestDataprovider)
-
-        super(TestDataproviders, self).__init__(tests)
+def test_suite():
+    collection = []
+    bases = [DataproviderTest]
+    for mod in soup.modules.all():
+        name = mod.__class__.__name__
+        attrs = {
+            "dataprovider": mod
+        }
+        testcase = type(name, bases, attrs)
+        suite = TestLoader().loadTestsFromTestCase(testcase)
+        collection.append(suite)
+    return unittest.TestSuite(collection)
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/test/soup/test_synchronization.py b/test/soup/test_synchronization.py
index 427b13d..cca9c9f 100644
--- a/test/soup/test_synchronization.py
+++ b/test/soup/test_synchronization.py
@@ -2,7 +2,7 @@ import unittest
 
 import soup
 
-class TestSynchronizationPair(soup.BaseTest):
+class TestSynchronizationPair(soup.TestCase):
 
     def __init__(self, source, sink):
         super(TestSynchronizationPair, self).__init__(self)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]