Page MenuHomeDevCentral

test_page.py
No OneTemporary

test_page.py

# -------------------------------------------------------------
# Rhyne-Wyse :: Tests :: Wiki :: Page
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: BSD-2-Clause
# -------------------------------------------------------------
import unittest
from rhyne_wyse.wiki.page import replace_between_markers
class PageTest(unittest.TestCase):
def test_replace_between_markers(self):
current = """The tree is:
[TREE]
Fir
[/TREE]
"""
expected = """The tree is:
[TREE]
Abies Electronicus
[/TREE]
"""
actual = replace_between_markers(
current,
"[TREE]",
"[/TREE]",
"Abies Electronicus",
)
self.assertEqual(expected, actual)
def test_replace_between_markers_when_missing(self):
self.assertRaises(
ValueError,
replace_between_markers,
"The tree is: Fir",
"[TREE]",
"[/TREE]",
"Abies Electronicus",
)
if __name__ == "__main__":
unittest.main()

File Metadata

Mime Type
text/x-python
Expires
Wed, Oct 22, 13:21 (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3091301
Default Alt Text
test_page.py (1 KB)

Event Timeline