def testTitleIndex(self):
     proxy=ReflectoFile(("reflecto.jpg",)).__of__(self.reflector)
     indexer=IIndexableContent(proxy)
     content=indexer.indexableContent(["Title"])
     self.assertEqual(content.getFields(), ["Title"])
     self.assertEqual(content.getFieldData("Title")[0]["content"],
                      "reflecto.jpg")
Exemple #2
0
 def testTitleIndex(self):
     proxy = ReflectoFile(("reflecto.jpg", )).__of__(self.reflector)
     indexer = IIndexableContent(proxy)
     content = indexer.indexableContent(["Title"])
     self.assertEqual(content.getFields(), ["Title"])
     self.assertEqual(
         content.getFieldData("Title")[0]["content"], "reflecto.jpg")
Exemple #3
0
 def testBinaryContent(self):
     proxy = ReflectoFile(("reflecto.jpg", )).__of__(self.reflector)
     #+ patch tom, 3.6.2008
     if queryUtility(proxy.Format()) is not None:
         #- patch
         indexer = IIndexableContent(proxy)
         content = indexer.indexableContent(["SearchableText"])
         self.assertEqual(content.getFields(), ["SearchableText"])
    def testTextContent(self):
        proxy=ReflectoFile(("reflecto.txt",)).__of__(self.reflector)
        indexer=IIndexableContent(proxy)
        content=indexer.indexableContent(["SearchableText"])
        self.assertEqual(content.getFields(), ["SearchableText"])

        data=content.getFieldData("SearchableText")
        self.failUnless(isinstance(data[0]["content"], unicode))
        self.failUnless(u"reflecto.txt" in data[0]["content"])
        self.failUnless(u"superhero" in data[1]["content"])
Exemple #5
0
    def testTextContent(self):
        proxy = ReflectoFile(("reflecto.txt", )).__of__(self.reflector)
        indexer = IIndexableContent(proxy)
        content = indexer.indexableContent(["SearchableText"])
        self.assertEqual(content.getFields(), ["SearchableText"])

        data = content.getFieldData("SearchableText")
        self.failUnless(isinstance(data[0]["content"], unicode))
        self.failUnless(u"reflecto.txt" in data[0]["content"])
        self.failUnless(u"superhero" in data[1]["content"])
 def testBinaryContent(self):
     proxy=ReflectoFile(("reflecto.jpg",)).__of__(self.reflector)
     indexer=IIndexableContent(proxy)
     content=indexer.indexableContent(["SearchableText"])
     self.assertEqual(content.getFields(), ["SearchableText"])
 def testReturnTypeWithFields(self):
     proxy=ReflectoFile(("reflecto.jpg",)).__of__(self.reflector)
     indexer=IIndexableContent(proxy)
     content=indexer.indexableContent(["Title"])
     self.failUnless(IIndexContentCollector.providedBy(content))
     self.failUnless(verifyObject(IIndexContentCollector, content))
 def testReturnTypeWithoutFields(self):
     proxy=ReflectoFile(("reflecto.jpg",)).__of__(self.reflector)
     indexer=IIndexableContent(proxy)
     self.assertEqual(indexer.indexableContent([]), None)
Exemple #9
0
 def testReturnTypeWithFields(self):
     proxy = ReflectoFile(("reflecto.jpg", )).__of__(self.reflector)
     indexer = IIndexableContent(proxy)
     content = indexer.indexableContent(["Title"])
     self.failUnless(IIndexContentCollector.providedBy(content))
     self.failUnless(verifyObject(IIndexContentCollector, content))
Exemple #10
0
 def testReturnTypeWithoutFields(self):
     proxy = ReflectoFile(("reflecto.jpg", )).__of__(self.reflector)
     indexer = IIndexableContent(proxy)
     self.assertEqual(indexer.indexableContent([]), None)
Exemple #11
0
 def testAdaption(self):
     proxy = ReflectoFile(("reflecto.jpg", )).__of__(self.reflector)
     indexer = IIndexableContent(proxy)
     self.failUnless(verifyObject(IIndexableContent, indexer))