1
0
Fork 0
mirror of https://github.com/Oreolek/gamebookformat.git synced 2024-06-09 11:48:13 +03:00
gamebookformat/test_sections.py
Pelle Nilsson f723ee0a9c Text format brackets.
Switched to text mark-up even more similar to org-mode, also more
similar to typical wiki mark-up, removing python-style format from
sections (but not from the templates).
2013-06-05 00:19:57 +02:00

48 lines
1.1 KiB
Python
Executable file

#!/usr/bin/env python2
import unittest
from unittest import TestCase
import sections
class TestSection(TestCase):
def setUp(self):
pass
def test_create(self):
sec = sections.Section("nnn", "text")
self.assertEqual(sec.name, "nnn")
self.assertEqual(sec.text, "text")
def test_add_tags(self):
sec = sections.Section("nnn", "text")
sec.add_tags(['a', 'b'])
self.assertTrue(sec.hastag('a'))
self.assertTrue(sec.hastag('b'))
sec.add_tags(['c', 'd'])
self.assertTrue(sec.hastag('a'))
self.assertTrue(sec.hastag('b'))
self.assertTrue(sec.hastag('c'))
self.assertTrue(sec.hastag('d'))
class TestBook(TestCase):
def setUp(self):
pass
def test_create(self):
b = sections.Book()
self.assertEqual(b.sections, [])
self.assertEqual(b.nr_sections, {})
self.assertEqual(b.max, 0)
class TestItem(TestCase):
def setUp(self):
pass
def test_create(self):
i = sections.Item("nn")
self.assertEqual(i.name, "nn")
if __name__ == '__main__':
unittest.main()