def testProvidesTiddlerTitle(self): """_generate_tiddler returns Tiddler's title""" doc = _getTiddlyWiki("modern") tiddlerElements = main._get_tiddler_elements(doc) tiddler = main._generate_tiddler(tiddlerElements[1]) actual = tiddler.title expected = "Bar" self.assertEqual(actual, expected)
def testProvidesTiddlerFields(self): """_generate_tiddler returns Tiddler's extended fields""" doc = _getTiddlyWiki("legacy") tiddlerElements = main._get_tiddler_elements(doc) tiddler = main._generate_tiddler(tiddlerElements[1]) actual = tiddler.fields expected = { "changecount": "1" } self.assertEqual(actual, expected)
def testReturnsTiddler(self): """_generate_tiddler returns Tiddler instance""" doc = _getTiddlyWiki("modern") tiddlerElements = main._get_tiddler_elements(doc) tiddler = main._generate_tiddler(tiddlerElements[0]) actual = tiddler.title expected = "Foo" self.assertEqual(actual, expected)
def testProvidesTiddlerTags(self): """_generate_tiddler returns Tiddler's tags""" doc = _getTiddlyWiki("modern") tiddlerElements = main._get_tiddler_elements(doc) tiddler = main._generate_tiddler(tiddlerElements[0]) actual = tiddler.tags expected = ["test", "tmp", u"x\xf6x"] self.assertEqual(actual, expected)
def testProvidesTiddlerModifier(self): """_generate_tiddler returns Tiddler's modifier""" doc = _getTiddlyWiki("modern") tiddlerElements = main._get_tiddler_elements(doc) tiddler = main._generate_tiddler(tiddlerElements[1]) actual = tiddler.modifier expected = "FND" self.assertEqual(actual, expected)
def testProvidesTiddlerModified(self): """_generate_tiddler returns Tiddler's modified attribute""" doc = _getTiddlyWiki("modern") tiddlerElements = main._get_tiddler_elements(doc) tiddler = main._generate_tiddler(tiddlerElements[0]) actual = tiddler.modified expected = datetime(2009, 03, 26, 10, 43) self.assertEqual(actual, expected)
def testProvidesTiddlerCreated(self): """_generate_tiddler returns Tiddler's created attribute""" doc = _getTiddlyWiki("legacy") tiddlerElements = main._get_tiddler_elements(doc) tiddler = main._generate_tiddler(tiddlerElements[1]) actual = tiddler.created expected = datetime(2009, 03, 26, 10, 42) self.assertEqual(actual, expected)
def testProvidesTiddlerText(self): """_generate_tiddler returns Tiddler's text""" doc = _getTiddlyWiki("legacy") tiddlerElements = main._get_tiddler_elements(doc) tiddler = main._generate_tiddler(tiddlerElements[0]) actual = tiddler.text expected = u"l\xf6rem ips\xfcm\n\nd\xc5lor s\xe4t\n\xe6met" self.assertEqual(actual, expected)