Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1import pytest 

2from e25_xml import myxml 

3 

4 

5def test_tagonly(): 

6 assert myxml('tagname') == '<tagname></tagname>' 

7 

8 

9def test_tag_simple_text(): 

10 assert myxml('tagname', 'text') == '<tagname>text</tagname>' 

11 

12 

13def test_nested(): 

14 assert myxml('a', 

15 myxml('b', 

16 myxml('c', 'text'))) == '<a><b><c>text</c></b></a>' 

17 

18 

19def test_attributes(): 

20 assert myxml('tagname', 

21 a=1, b=2, c=3) == '<tagname a="1" b="2" c="3"></tagname>' 

22 

23 

24def test_attributes_and_text(): 

25 assert myxml('tagname', 'text', 

26 a=1, b=2, c=3) == '<tagname a="1" b="2" c="3">text</tagname>'