source: products/qPingTool/trunk/tests/testPropertiesToolConf.py

Last change on this file was 205, checked in by chervol, 15 years ago

fixed labels in configlet

File size: 1.4 KB
Line 
1
2from base import TestCase
3from config import nt_properties, s_properties
4
5class TestPropertiesToolConf(TestCase):
6
7    def afterSetUp(self):
8        self.ptool = self.portal.portal_properties
9
10    def testConfigurationNavtreePropertiesTool(self):
11        # Configuration navtree_properties
12        props = self.ptool.navtree_properties
13        for prop_id, prop_type, prop_value in nt_properties:
14           self.assert_(prop_id in props.propertyIds())
15           self.assertEqual(props.getPropertyType(prop_id), prop_type)
16           p_value = list(props.getProperty(prop_id))
17           prop_value.sort()
18           p_value.sort()
19           self.assertEqual([v for v in prop_value if v in p_value], prop_value)
20
21    def testConfigurationSitePropertiesTool(self):
22        # Configuration site_properties
23        props = self.ptool.site_properties
24        for prop_id, prop_type, prop_value in s_properties:
25           self.assert_(prop_id in props.propertyIds())
26           self.assertEqual(props.getPropertyType(prop_id), prop_type)
27           p_value = list(props.getProperty(prop_id))
28           prop_value.sort()
29           p_value.sort()
30           self.assertEqual([v for v in prop_value if v in p_value], prop_value)
31
32def test_suite():
33    from unittest import TestSuite, makeSuite
34    suite = TestSuite()
35    suite.addTest(makeSuite(TestPropertiesToolConf))
36    return suite
37
Note: See TracBrowser for help on using the repository browser.