예제 #1
0
 def test_read_3(self):
     r = io.StringIO(
         "<Dates><Nineties>\t\t</Nineties><Eighties>\t</Eighties></Dates>")
     a = ['']
     b = wcdb_read(r, a)
     self.assertTrue(b == True)
     self.assertTrue(
         a[0] ==
         "<Dates><Nineties></Nineties><Eighties></Eighties></Dates>")
예제 #2
0
 def test_read_4(self):
     reader = StringIO.StringIO(
         "<Mathematics><Physics><Chemistry></Chemistry></Physics></Mathematics>"
     )
     tree = wcdb_read(reader)
     treeStr = ET.tostring(tree)
     self.assertTrue(
         treeStr ==
         "<Mathematics><Physics><Chemistry /></Physics></Mathematics>")
예제 #3
0
 def test_read_2(self):
     r = io.StringIO(
         "<Cookies>\n\t<Thin Mints></Thin Mints>\n\t<Samoas></Samoas>\n</Cookies>"
     )
     a = ['']
     b = wcdb_read(r, a)
     self.assertTrue(b == True)
     self.assertTrue(
         a[0] ==
         "<Cookies><Thin Mints></Thin Mints><Samoas></Samoas></Cookies>")
예제 #4
0
 def test_read_5(self):
     reader = StringIO.StringIO("<Herp><Derp></Derp></Herp>")
     tree = wcdb_read(reader)
     treeStr = ET.tostring(tree)
     self.assertTrue(treeStr == "<Herp><Derp /></Herp>")
예제 #5
0
 def test_read_3(self):
     reader = StringIO.StringIO("<W><C><D><B></B></D></C></W>")
     tree = wcdb_read(reader)
     treeStr = ET.tostring(tree)
     self.assertTrue(treeStr == "<W><C><D><B /></D></C></W>")
예제 #6
0
 def test_read_tabs(self):
     reader = StringIO.StringIO("<one>   \t<two>   \t     </two> \n</one>")
     tree = wcdb_read(reader)
     treeStr = ET.tostring(tree)
     self.assertTrue(treeStr == "<one>   \t<two>   \t     </two> \n</one>")
예제 #7
0
 def test_read_spacing(self):
     reader = StringIO.StringIO("<one>   <two>        </two> </one>")
     tree = wcdb_read(reader)
     treeStr = ET.tostring(tree)
     self.assertTrue(treeStr == "<one>   <two>        </two> </one>")
예제 #8
0
 def test_read_2(self):
     reader = StringIO.StringIO("<a><b><c></c><d></d><e></e></b></a>")
     tree = wcdb_read(reader)
     treeStr = ET.tostring(tree)
     self.assertTrue(treeStr == "<a><b><c /><d /><e /></b></a>")
예제 #9
0
 def test_read_1(self):
     reader = StringIO.StringIO(
         "<outer1><inner1></inner1><inner2></inner2></outer1>")
     tree = wcdb_read(reader)
     treeStr = ET.tostring(tree)
     self.assertTrue(treeStr == "<outer1><inner1 /><inner2 /></outer1>")
예제 #10
0
 def test_read_6(self):
     r = io.StringIO("<one></one>")
     a = ['']
     b = wcdb_read(r, a)
     self.assertTrue(b == True)
     self.assertTrue(a[0] == '<one></one>')
예제 #11
0
 def test_read_4(self):
     r = io.StringIO("<one>\t\t\t<two>\n\t\t</two></one>")
     a = ['']
     b = wcdb_read(r, a)
     self.assertTrue(b == True)
     self.assertTrue(a[0] == "<one><two></two></one>")
예제 #12
0
 def test_read(self):
     r = io.StringIO("<Chocolate><Cake>Hello</Cake></Chocolate>")
     a = ['']
     b = wcdb_read(r, a)
     self.assertTrue(b == True)
     self.assertTrue(a[0] == "<Chocolate><Cake>Hello</Cake></Chocolate>")