Changeset 765

Show
Ignore:
Timestamp:
08/05/08 13:43:22 (4 months ago)
Author:
sylvain
Message:

More amplee.atompub.service test coverage

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • oss/amplee/amplee/test/store.conf

    r653 r765  
    4343base_edit_uri = gig/ 
    4444base_media_edit_uri = gig/ 
     45xml_attrs = id,gig 
    4546accept_media_types = application/atom+xml;type=entry,image/jpeg,text/plain,image/png,image/gif 
    4647enable_cache = False 
  • oss/amplee/amplee/test/test_service.py

    r621 r765  
    44 
    55from amplee.loader.iniloader import loader 
     6from amplee.utils import ATOM10_NS 
    67 
    78base_dir = os.getcwd() 
     
    3233        self.assertEqual(len(workspaces), 1) 
    3334        self.assertEqual(unicode(workspaces[0].title), self.service.workspaces[0].title) 
     35 
     36    def test_04_collection(self): 
     37        cols = self.service.get_collections() 
     38        self.assertEqual(len(cols), 1) 
     39 
     40        col = self.service.get_collection('gigs') 
     41        self.failIfEqual(col, None) 
     42 
     43        col = self.service.get_collection_by_xml_id('gig') 
     44        self.failIfEqual(col, None) 
     45 
     46        col = self.service.get_collection_by_uri('http://localhost:8090/gig/') 
     47        self.failIfEqual(col, None) 
     48 
     49    def test_05_feed(self): 
     50        doc = self.service.make_feed(items=[], xslt_path=u'some/path') 
     51        self.assert_(ATOM10_NS == doc.feed.namespaceURI) 
     52        self.assertEqual(doc.xml_children[0].target, u"xml-stylesheet") 
     53        self.assertEqual(doc.xml_children[0].data, u'href="some/path" type="text/xsl"') 
    3454                          
    3555if __name__ == '__main__':