import reader

import os
import shutil

def test_of_xml_reader():
    test_dir_name = "xml_test_files"
    shutil.rmtree(test_dir_name, ignore_errors=True)
    os.mkdir(test_dir_name)
    xml_dir_path =  os.path.join(".", test_dir_name)
    document = """\
        <slideshow>
        <title>Demo slideshow</title>
        <slide><title>Slide title</title>
        <point>This is a demo</point>
        <point>Of a program for processing slides</point>
        </slide>

        <slide><title>Another demo slide</title>
        <point>It is important</point>
        <point>To have more than</point>
        <point>one slide</point>
        </slide>
        </slideshow>
        """
    for x in range(0, 10):
        f = open(os.path.join(xml_dir_path, str(x) + ".xml"),"w");
        f.write(document)
        f.close()

    r = reader.XmlReader(xml_dir_path)
    r.read_files()
    assert 10 == len(r.return_tree_files())



@@ -918,9 +918,875 @@
 les())%0A%0A
+def test_of_xml_reader_1():%0A    test_dir_name = %22xml_test_files%22%0A    shutil.rmtree(test_dir_name, ignore_errors=True)%0A    os.mkdir(test_dir_name)%0A    xml_dir_path =  os.path.join(%22.%22, test_dir_name)%0A    document = %22%22%22%5C%0A        %3Cslideshow%3E%0A        %3Ctitle%3EDemo slideshow%3C/title%3E%0A        %3Cslide%3E%3Ctitle%3ESlide title%3C/title%3E%0A        %3Cpoint%3EThis is a demo%3C/point%3E%0A        %3Cpoint%3EOf a program for processing slides%3C/point%3E%0A        %3C/slide%3E%0A%0A        %3Cslide%3E%3Ctitle%3EAnother demo slide%3C/title%3E%0A        %3Cpoint%3EIt is important%3C/point%3E%0A        %3Cpoint%3ETo have more than%3C/point%3E%0A        %3Cpoint%3Eone slide%3C/point%3E%0A        %3C/slide%3E%0A        %3C/slideshow%3E%0A        %22%22%22%0A    for x in range(0, 10):%0A        f = open(os.path.join(xml_dir_path, str(x) + %22.xml%22),%22w%22);%0A        f.write(document)%0A        f.close()%0A%0A    r = reader.XmlReader(xml_dir_path)%0A    assert 10 == len(r.return_tree_files())
 %0A

add test to reader