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 #2
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))
 def test_flatten(self):
     testlist = [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
     reslist = xml_util.flatten(testlist)
     goallist = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
     self.assertTrue(reslist == goallist, \
         "{0}\nshould be\n{1}".format(reslist,goallist))
Example #4
0
 def test_flatten(self):
     testlist = [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
     reslist = xml_util.flatten(testlist)
     goallist = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
     self.assertTrue(reslist == goallist, "{0}\nshould be\n{1}".format(reslist, goallist))