"test des kleinen Wiki Systems" import pytest import wiki @pytest.fixture def pages(): w=wiki.PageManager(file="") w.from_dict({ "home": {}, "home/hello":{}, "home/hello2":{"path":"homehello"} }) return w class TestPageAttribute: def test_id(self,pages): assert pages["home"].id=="home" def test_page_hello(pages): assert isinstance(pages["home"],wiki.Page) class TestPageParsing: def test_leave_html(self): t="Hello" tout, entities=wiki.parse_intern_page(t) assert t==tout def test_replacebrakcets_html(self): t="Hello" tout, entities=wiki.parse_intern_page(t) assert not t==tout assert tout=='Hello' def test_replace_tags_html(self): t="Hello" tout, entities=wiki.parse_intern_page(t) assert not t==tout assert tout=='Hello' def test_replace_tags_inentities(self): t="Hello" tout, entities=wiki.parse_intern_page(t) assert "uj" in entities["tags"]