Exemplo n.º 1
0
 def test_update(self):
     self.update_page(u'.schema Book\n[[author::AK]]\n{{isbn::1234567890}}\n[[datePublished::2013]]', u'Hello')
     self.update_page(u'.schema Book\n[[author::AK]]\n{{isbn::1234567899}}\n[[dateModified::2013]]', u'Hello')
     self.assertTrue(SchemaDataIndex.has_match(u'Hello', u'author', u'AK'))
     self.assertFalse(SchemaDataIndex.has_match(u'Hello', u'isbn', u'1234567890'))
     self.assertTrue(SchemaDataIndex.has_match(u'Hello', u'isbn', u'1234567899'))
     self.assertFalse(SchemaDataIndex.has_match(u'Hello', u'datePublished', u'2013'))
     self.assertTrue(SchemaDataIndex.has_match(u'Hello', u'dateModified', u'2013'))
Exemplo n.º 2
0
 def test_create(self):
     self.update_page(
         u'.schema Book\n[[author::AK]]\n{{isbn::1234567890}}\n[[datePublished::2013]]',
         u'Hello')
     self.assertTrue(SchemaDataIndex.has_match(u'Hello', u'author', u'AK'))
     self.assertTrue(
         SchemaDataIndex.has_match(u'Hello', u'isbn', u'1234567890'))
     self.assertTrue(
         SchemaDataIndex.has_match(u'Hello', u'datePublished', u'2013'))
Exemplo n.º 3
0
 def test_rebuild(self):
     page = self.update_page(
         u'.schema Book\n[[author::AK]]\n{{isbn::1234567890}}\n[[datePublished::2013]]',
         u'Hello')
     SchemaDataIndex.rebuild_index(page.title, page.data)
     self.assertTrue(SchemaDataIndex.has_match(u'Hello', u'author', u'AK'))
     self.assertTrue(
         SchemaDataIndex.has_match(u'Hello', u'isbn', u'1234567890'))
     self.assertTrue(
         SchemaDataIndex.has_match(u'Hello', u'datePublished', u'2013'))
Exemplo n.º 4
0
 def test_should_not_index_for_longtext(self):
     self.update_page(u'longDescription::---\n\nHello there', u'Hello')
     self.assertFalse(SchemaDataIndex.has_match(u'Hello', u'longDescription', u'Hello there'))
Exemplo n.º 5
0
 def test_rebuild(self):
     page = self.update_page(u'.schema Book\n[[author::AK]]\n{{isbn::1234567890}}\n[[datePublished::2013]]', u'Hello')
     SchemaDataIndex.rebuild_index(page.title, page.data)
     self.assertTrue(SchemaDataIndex.has_match(u'Hello', u'author', u'AK'))
     self.assertTrue(SchemaDataIndex.has_match(u'Hello', u'isbn', u'1234567890'))
     self.assertTrue(SchemaDataIndex.has_match(u'Hello', u'datePublished', u'2013'))
Exemplo n.º 6
0
 def test_should_not_index_for_longtext(self):
     self.update_page(u'longDescription::---\n\nHello there', u'Hello')
     self.assertFalse(
         SchemaDataIndex.has_match(u'Hello', u'longDescription',
                                   u'Hello there'))