def test_extend_padding_string(self):
     testlist = [['a', 'b', 'c'], ['d']]
     reslist = xml_util.extend_padding(testlist)
     goallist = [['a', 'b', 'c'], ['d', '', '']]
     self.assertTrue(reslist == goallist, \
         "{0}\nshould be\n{1}".format(reslist,goallist))
 def test_extend_padding(self):
     testlist = [[1, 2, 3], [4, 5], [5, 6, 7, 8]]
     reslist = xml_util.extend_padding(testlist, 0)
     goallist = [[1, 2, 3, 0], [4, 5, 0, 0], [5, 6, 7, 8]]
     self.assertTrue(reslist == goallist, \
         "{0}\nshould be\n{1}".format(reslist,goallist))
Example #3
0
 def test_extend_padding_string(self):
     testlist = [["a", "b", "c"], ["d"]]
     reslist = xml_util.extend_padding(testlist)
     goallist = [["a", "b", "c"], ["d", "", ""]]
     self.assertTrue(reslist == goallist, "{0}\nshould be\n{1}".format(reslist, goallist))
Example #4
0
 def test_flatten_with_extend_multiple(self):
     testlist = [[1, 4, 7], [2], [3, 6]]
     testlist = xml_util.extend_padding(testlist, 0)
     reslist = xml_util.flatten(testlist)
     goallist = [[1, 2, 3], [4, 0, 6], [7, 0, 0]]
     self.assertTrue(reslist == goallist, "{0}\nshould be\n{1}".format(reslist, goallist))
Example #5
0
 def test_extend_padding(self):
     testlist = [[1, 2, 3], [4, 5], [5, 6, 7, 8]]
     reslist = xml_util.extend_padding(testlist, 0)
     goallist = [[1, 2, 3, 0], [4, 5, 0, 0], [5, 6, 7, 8]]
     self.assertTrue(reslist == goallist, "{0}\nshould be\n{1}".format(reslist, goallist))