From ba4762d274fef839244622d58df636801c43ce2d Mon Sep 17 00:00:00 2001 From: Olivier Guilyardi Date: Fri, 19 Feb 2010 17:42:13 +0000 Subject: [PATCH] use the custom test runner and base testcase in component test --- tests/testcomponent.py | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/tests/testcomponent.py b/tests/testcomponent.py index a10dccb..6638c30 100644 --- a/tests/testcomponent.py +++ b/tests/testcomponent.py @@ -1,22 +1,13 @@ from timeside.component import * +from timeside.tests import TestCase, TestRunner import unittest -class TestComponentArchitecture(unittest.TestCase): - - def assertSameList(self, list1, list2): - if len(list1) != len(list2): - self.fail("Lists length differ : %d != %d" % (len(list1), len(list2))) - - for item in list1: - if not item in list2: - self.fail("%s is not in list2" % str(item)) - - for item in list2: - if not item in list1: - self.fail("%s is not in list1" % str(item)) - +__all__ = ['TestComponentArchitecture'] +class TestComponentArchitecture(TestCase): + "Test the component and interface system" + def testOneInterface(self): "Test a component implementing one interface" self.assertSameList(implementations(I1), [C1]) @@ -88,6 +79,7 @@ class TestComponentArchitecture(unittest.TestCase): except ComponentError: pass + class I1(Interface): pass @@ -170,5 +162,5 @@ class C11(Component): implements(I11) if __name__ == '__main__': - unittest.main() + unittest.main(testRunner=TestRunner()) -- 2.39.5