source: products/qPloneGoogleMaps/tags/0.1.0/tests/testAdapters.py @ 1591

Last change on this file since 1591 was 1, checked in by myroslav, 15 years ago

Building directory structure

  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1
2""" This module contains class that tests MarkersListing adapter """
3
4import os, sys
5if __name__ == '__main__':
6    execfile(os.path.join(sys.path[0], 'framework.py'))
7
8from commonTestingStuff import *
9
10class TestForInterfaces(PloneTestCase.PloneTestCase):
11    """ Class for testing adapters' and browsers' for interfaces """
12
13    def testAdapterInterface(self):
14        """ Test adapters' for intefaces """
15        verifyClass(IMarkersListing, MarkersListing)
16
17    def testBrowserInterface(self):
18        """ Test browsers' for intefaces """
19        verifyClass(IMarkersView, MarkersView)
20
21class TestMarkersListing(PloneTestCase.PloneTestCase):
22    """ Class for testing MarkersListing adapter """
23
24    def afterSetUp(self):
25        """ AfterSetUp features """
26        pass
27
28    def testImplementation(self):
29        """ Test adapters implementation """
30        IMarkersListing.implementedBy(MarkersListing)
31
32    def testListMarkersAdapterMethod(self):
33        """ Test listMarkers adapters' method """
34        maps_login(self, 'member')
35        self.folder.invokeFactory('Folder', 'source_folder')
36        self.folder.source_folder.invokeFactory('Document', 'test_page')
37        folder_adapter = IMarkersListing(self.folder.source_folder)
38        self.failUnless(folder_adapter.listMarkers() == [],
39                        "listMarkers adapters' method return incorrect value")
40        IGEOLocated(self.folder.source_folder.test_page).setLocation(FIELD_VALUE[0], FIELD_VALUE[1])
41        self.folder.source_folder.test_page.reindexObject()
42        self.failUnless(folder_adapter.listMarkers()[0].getId == 'test_page',
43                        "listMarkers adapters' method return incorrect value")
44
45def test_suite():
46    from unittest import TestSuite, makeSuite
47    suite = TestSuite()
48    suite.addTest(makeSuite(TestForInterfaces))
49    suite.addTest(makeSuite(TestMarkersListing))
50    return suite
51
52if __name__ == '__main__':
53    framework()
Note: See TracBrowser for help on using the repository browser.