Example #1
0
	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)
Example #2
0
	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)
Example #3
0
	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)
Example #4
0
	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)
Example #5
0
	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)
Example #6
0
	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)
Example #7
0
	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)
Example #8
0
	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)