示例#1
0
 def test_sort_option_int(self):
     "Sorting the table by an int field, Number of Pages"
     t = TableFu(self.csv_file)
     pages = t.values('Number of Pages')
     pages = sorted(pages, reverse=True)
     t.sort('Number of Pages', reverse=True)
     self.assertEqual(t.values('Number of Pages'), pages)
示例#2
0
 def test_sort_option_int(self):
     "Sorting the table by an int field, Number of Pages"
     t = TableFu(self.csv_file)
     pages = t.values('Number of Pages')
     pages = sorted(pages, reverse=True)
     t.sort('Number of Pages', reverse=True)
     self.assertEqual(t.values('Number of Pages'), pages)
示例#3
0
 def test_sort(self):
     "Sort a table in place"
     t = TableFu(self.csv_file)
     self.table.pop(0)
     self.table.sort(key=lambda row: row[0])
     t.sort('Author')
     self.assertEqual(t[0].cells, self.table[0])
示例#4
0
 def test_sort(self):
     "Sort a table in place"
     t = TableFu(self.csv_file)
     self.table.pop(0)
     self.table.sort(key=lambda row: row[0])
     t.sort('Author')
     self.assertEqual(
         t[0].cells,
         self.table[0]
     )