Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)

src/p/r/Products.MimetypesRegistry-2.0.5/Products/MimetypesRegistry/tests/test_mimetypes.py   Products.MimetypesRegistry(Download)
    def testAdaptMt(self):
        data, filename, mt = self.registry('bar', mimetype='text/xml')
        # this test that data has been adaped and file seeked to 0
        self.failUnlessEqual(data, 'bar')
        self.failUnlessEqual(filename, None)
        self.failUnless(isinstance(mt, text_xml), str(mt))
 
    def testAdaptFile(self):
        file = open(input_file_path("rest1.rst"))
        data, filename, mt = self.registry(file)
    def testAdaptData(self):
        data, filename, mt = self.registry('<?xml ?>')
        # this test that data has been adaped and file seeked to 0
        self.failUnlessEqual(data, '<?xml ?>')
        self.failUnlessEqual(filename, None)