Exemplo n.º 1
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")
Exemplo n.º 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")
Exemplo n.º 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"])
Exemplo n.º 4
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"])
Exemplo n.º 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"])
Exemplo n.º 6
0
 def testBinaryContent(self):
     proxy=ReflectoFile(("reflecto.jpg",)).__of__(self.reflector)
     indexer=IIndexableContent(proxy)
     content=indexer.indexableContent(["SearchableText"])
     self.assertEqual(content.getFields(), ["SearchableText"])
Exemplo n.º 7
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))
Exemplo n.º 8
0
 def testReturnTypeWithoutFields(self):
     proxy=ReflectoFile(("reflecto.jpg",)).__of__(self.reflector)
     indexer=IIndexableContent(proxy)
     self.assertEqual(indexer.indexableContent([]), None)
Exemplo n.º 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))
Exemplo n.º 10
0
 def testReturnTypeWithoutFields(self):
     proxy = ReflectoFile(("reflecto.jpg", )).__of__(self.reflector)
     indexer = IIndexableContent(proxy)
     self.assertEqual(indexer.indexableContent([]), None)