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

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

fixed labels in configlet

File size: 1.1 KB
Line 
1#
2# PingInfo TestCase
3#
4
5import os, sys
6if __name__ == '__main__':
7    execfile(os.path.join(sys.path[0], 'framework.py'))
8
9from base import *
10
11class TestPingInfo(TestCase):
12
13    def afterSetUp(self):
14        self.loginAsPortalOwner()
15        self.portal.invokeFactory('PingTool', id='pt1', title='Ping Tool 1')
16        self.pt1 = getattr(self.portal, 'pt1', None)
17        self.portal.invokeFactory('PingInfo', id='pi1', title='Ping Info 1')
18        self.pi1 = getattr(self.portal, 'pi1', None)
19
20    def testAddedPingInfo(self):
21        self.pi1.setUrl('http://nohost')
22        self.failUnlessEqual(self.pi1.getUrl(), 'http://nohost')
23        self.failUnlessEqual(self.pi1.getMethod_name(), 'weblogUpdates.ping')
24        self.pi1.setMethod_name('testmethod')
25        self.failUnlessEqual(self.pi1.getMethod_name(), 'testmethod')       
26        self.pi1.setRss_version(self.pi1.Vocabulary('rss_version')[0][-1])
27        self.failUnlessEqual(self.pi1.getRss_version(), 'RSS2')
28
29
30def test_suite():
31    from unittest import TestSuite, makeSuite
32    suite = TestSuite()
33    suite.addTest(makeSuite(TestPingInfo))
34    return suite
35
36if __name__ == '__main__':
37    framework()
38
Note: See TracBrowser for help on using the repository browser.