def testDecodesLegacyTiddlers(self): """_get_text decodes legacy-store tiddlers' contents""" doc = _getTiddlyWiki("legacy") tiddlers = main._get_tiddler_elements(doc) actual = main._get_text(tiddlers[0]) expected = u"l\xf6rem ips\xfcm\n\nd\xc5lor s\xe4t\n\xe6met" self.assertEqual(expected, actual)
def testSupportsModernStore(self): """_get_text supports modern (v2.2+) store format""" doc = _getTiddlyWiki("modern") tiddlers = main._get_tiddler_elements(doc) actual = main._get_text(tiddlers[0]) expected = u"l\xf6rem ips\xfcm\n\nd\xc5lor s\xe4t\n\xe6met" self.assertEqual(expected, actual)
def testSupportsLegacyStore(self): """_get_text supports legacy (pre-v2.2) store format""" doc = _getTiddlyWiki("legacy") tiddlers = main._get_tiddler_elements(doc) actual = main._get_text(tiddlers[1]) expected = u"consectetur adipisicing elit" self.assertEqual(expected, actual)
def testReturnsTiddlerContents(self): """_get_text returns tiddler elements' contents""" doc = _getTiddlyWiki("modern") tiddlers = main._get_tiddler_elements(doc) actual = main._get_text(tiddlers[1]) expected = u"consectetur adipisicing elit" self.assertEqual(expected, actual)